|
@@ -367,7 +367,14 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import {delAttr, getAttr, getObjAttr} from "@/api/basecfg/objAttribute";
|
|
import {delAttr, getAttr, getObjAttr} from "@/api/basecfg/objAttribute";
|
|
import {addAttrValueBatch} from "@/api/basecfg/objAttributeValue";
|
|
import {addAttrValueBatch} from "@/api/basecfg/objAttributeValue";
|
|
import {getDevProcess} from "@/api/commonApi";
|
|
import {getDevProcess} from "@/api/commonApi";
|
|
-import {addComponent, getComponent, listByDevice, listComponent, updateComponent} from "@/api/basecfg/component";
|
|
|
|
|
|
+import {
|
|
|
|
+ addComponent,
|
|
|
|
+ delComponent,
|
|
|
|
+ getComponent,
|
|
|
|
+ listByDevice,
|
|
|
|
+ listComponent,
|
|
|
|
+ updateComponent
|
|
|
|
+} from "@/api/basecfg/component";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'Device',
|
|
name: 'Device',
|
|
@@ -463,12 +470,12 @@ export default {
|
|
deviceCode: [
|
|
deviceCode: [
|
|
{required: true, message: "设备code不能为空", trigger: "blur"}
|
|
{required: true, message: "设备code不能为空", trigger: "blur"}
|
|
],
|
|
],
|
|
- // attrKey: [
|
|
|
|
- // {required: true, message: "属性标识不能为空", trigger: "blur"}
|
|
|
|
- // ],
|
|
|
|
- // attrName: [
|
|
|
|
- // {required: true, message: "属性名称不能为空", trigger: "blur"}
|
|
|
|
- // ],
|
|
|
|
|
|
+ compoCode: [
|
|
|
|
+ { required: true, message: "部件编码不能为空", trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ psCode: [
|
|
|
|
+ { required: true, message: "工艺标签代码不能为空", trigger: "blur" }
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -509,7 +516,7 @@ export default {
|
|
handleComponentUpdate(row) {
|
|
handleComponentUpdate(row) {
|
|
this.componentReset();
|
|
this.componentReset();
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
- updateComponent(id).then(response => {
|
|
|
|
|
|
+ getComponent(id).then(response => {
|
|
this.componentForm = response.data;
|
|
this.componentForm = response.data;
|
|
this.componentOpen = true;
|
|
this.componentOpen = true;
|
|
this.title = "修改设备器件属性";
|
|
this.title = "修改设备器件属性";
|
|
@@ -518,7 +525,7 @@ export default {
|
|
handleComponentDelete(row) {
|
|
handleComponentDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
this.$modal.confirm('是否确认删除能源对象属性编号为"' + ids + '"的数据项?').then(function() {
|
|
this.$modal.confirm('是否确认删除能源对象属性编号为"' + ids + '"的数据项?').then(function() {
|
|
- return delAttr(ids);
|
|
|
|
|
|
+ return delComponent(ids);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
console.log("删除row",row.deviceCode);
|
|
console.log("删除row",row.deviceCode);
|
|
this.getComponentList(row.deviceCode);
|
|
this.getComponentList(row.deviceCode);
|
|
@@ -549,9 +556,9 @@ export default {
|
|
this.componentReset();
|
|
this.componentReset();
|
|
},
|
|
},
|
|
/**查询部件列表*/
|
|
/**查询部件列表*/
|
|
- getComponentList(){
|
|
|
|
- listComponent(this.queryParams).then(response=>{
|
|
|
|
- this.ComponentList=response.data
|
|
|
|
|
|
+ getComponentList(deviceCode){
|
|
|
|
+ listByDevice(deviceCode).then(response => {
|
|
|
|
+ this.ComponentList=response.data;
|
|
console.log("查询部件列表",this.ComponentList)
|
|
console.log("查询部件列表",this.ComponentList)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -645,9 +652,7 @@ export default {
|
|
this.ComponentRow = row
|
|
this.ComponentRow = row
|
|
console.log("row",row)
|
|
console.log("row",row)
|
|
listByDevice(this.ComponentRow.deviceCode).then(response => {
|
|
listByDevice(this.ComponentRow.deviceCode).then(response => {
|
|
- const data=response.data;
|
|
|
|
- console.log("data",data);
|
|
|
|
- this.ComponentList=data
|
|
|
|
|
|
+ this.ComponentList=response.data;
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
@@ -704,25 +709,6 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
- // submitForm () {
|
|
|
|
- // this.$refs['form'].validate(valid => {
|
|
|
|
- // if (valid) {
|
|
|
|
- // if (this.form.id != null) {
|
|
|
|
- // updateDevice(this.form).then(response => {
|
|
|
|
- // this.$modal.msgSuccess('修改成功')
|
|
|
|
- // this.open = false
|
|
|
|
- // this.getList()
|
|
|
|
- // })
|
|
|
|
- // } else {
|
|
|
|
- // addDevice(this.form).then(response => {
|
|
|
|
- // this.$modal.msgSuccess('新增成功')
|
|
|
|
- // this.open = false
|
|
|
|
- // this.getList()
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
submitForm() {
|
|
submitForm() {
|
|
// 重置 attrList 和 form.customAttrs
|
|
// 重置 attrList 和 form.customAttrs
|
|
if (!this.attrList) {
|
|
if (!this.attrList) {
|
|
@@ -742,9 +728,9 @@ export default {
|
|
if (existingIndex === -1) {
|
|
if (existingIndex === -1) {
|
|
// 如果attrKey不存在于dataToSubmit中,则添加
|
|
// 如果attrKey不存在于dataToSubmit中,则添加
|
|
dataToSubmit.push({
|
|
dataToSubmit.push({
|
|
- modelCode: this.form.deviceModel, // 这里填写模型代码
|
|
|
|
- objCode: this.form.deviceCode, // 这里填写设备代码
|
|
|
|
- objType: 2, // 这里填写对象类型
|
|
|
|
|
|
+ modelCode: this.form.deviceModel, // 模型代码
|
|
|
|
+ objCode: this.form.deviceCode, // 设备代码
|
|
|
|
+ objType: 2, // 对象类型
|
|
attrKey: attrKey,
|
|
attrKey: attrKey,
|
|
attrValue: attrValue,
|
|
attrValue: attrValue,
|
|
attrName: attrName
|
|
attrName: attrName
|
|
@@ -762,9 +748,9 @@ export default {
|
|
if (existingIndex === -1) {
|
|
if (existingIndex === -1) {
|
|
// 如果attrKey不存在于dataToSubmit中,则添加
|
|
// 如果attrKey不存在于dataToSubmit中,则添加
|
|
dataToSubmit.push({
|
|
dataToSubmit.push({
|
|
- modelCode: '', // 这里填写模型代码
|
|
|
|
- objCode: this.form.deviceCode, // 这里填写设备代码
|
|
|
|
- objType: 2, // 这里填写对象类型
|
|
|
|
|
|
+ modelCode: '', // 模型代码
|
|
|
|
+ objCode: this.form.deviceCode, // 设备代码
|
|
|
|
+ objType: 2, // 对象类型
|
|
attrKey: attrKey,
|
|
attrKey: attrKey,
|
|
attrValue: attrValue,
|
|
attrValue: attrValue,
|
|
attrName:attrName
|
|
attrName:attrName
|
|
@@ -974,47 +960,42 @@ export default {
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.divider {
|
|
.divider {
|
|
- border-bottom: 2px solid #ebeef5; /* 这是Element UI的默认边框颜色,你可以根据需要调整 */
|
|
|
|
- margin: 10px 0; /* 这是横线与内容的间距,你可以根据需要调整 */
|
|
|
|
|
|
+ border-bottom: 2px solid #ebeef5;
|
|
|
|
+ margin: 10px 0;
|
|
}
|
|
}
|
|
.section-title {
|
|
.section-title {
|
|
- font-size: 18px; /* 标题字体大小 */
|
|
|
|
- font-weight: bold; /* 字体加粗 */
|
|
|
|
- margin-top: 20px; /* 标题顶部间距 */
|
|
|
|
- margin-bottom: 10px; /* 标题底部间距 */
|
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ margin-bottom: 10px;
|
|
}
|
|
}
|
|
.drawer-content {
|
|
.drawer-content {
|
|
padding: 0 20px;
|
|
padding: 0 20px;
|
|
}
|
|
}
|
|
|
|
|
|
-.divider {
|
|
|
|
- border-bottom: 2px solid #ebeef5; /* 这是Element UI的默认边框颜色,你可以根据需要调整 */
|
|
|
|
- margin: 10px 0; /* 这是横线与内容的间距,你可以根据需要调整 */
|
|
|
|
-}
|
|
|
|
|
|
|
|
.section-title {
|
|
.section-title {
|
|
- font-size: 18px; /* 标题字体大小 */
|
|
|
|
- font-weight: bold; /* 字体加粗 */
|
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
|
|
|
|
.attr-list-container {
|
|
.attr-list-container {
|
|
- border: 1px solid #ccc; /* 给ul添加外框 */
|
|
|
|
- padding: 10px; /* 内边距 */
|
|
|
|
- margin: 10px 0; /* 外边距 */
|
|
|
|
- font-weight: bold; /* 加粗标题 */
|
|
|
|
|
|
+ border: 1px solid #ccc;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
|
|
|
|
.attr-list-container h3 {
|
|
.attr-list-container h3 {
|
|
- font-weight: bold; /* 加粗标题 */
|
|
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
|
|
|
|
.attr-item {
|
|
.attr-item {
|
|
- list-style-type: none; /* 移除列表项前的默认符号 */
|
|
|
|
- margin-bottom: 5px; /* 列表项之间的间距 */
|
|
|
|
|
|
+ list-style-type: none;
|
|
|
|
+ margin-bottom: 5px;
|
|
}
|
|
}
|
|
-
|
|
|
|
.attr-name {
|
|
.attr-name {
|
|
- font-weight: bold; /* 加粗属性名称 */
|
|
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
|
|
|
|
</style>
|
|
</style>
|