-
+
@@ -61,7 +61,7 @@
- 修改
+ 修改
删除
系统定义,不能修改
@@ -142,7 +142,7 @@
-
+
@@ -292,8 +292,8 @@ export default {
tenantId: null,
tenantName: null,
identifier: null,
- type: null,
- datatype: null,
+ type: 1,
+ datatype: "integer",
isSys: null,
isTop: null,
isMonitor: null,
@@ -303,7 +303,13 @@ export default {
updateBy: null,
updateTime: null,
remark: null,
- specs: null,
+ specs: {
+ enumList: [{
+ value: "",
+ text: ""
+ }],
+ arrayType: "int"
+ },
};
this.resetForm("form");
},
@@ -328,23 +334,27 @@ export default {
this.reset();
this.open = true;
this.title = "添加通用物模型";
- this.form.type = 1;
- this.form.datatype = "integer"
- this.form.specs = {
- enumList: [],
- arrayType: "int"
- };
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const templateId = row.templateId || this.ids;
getTemplate(templateId).then((response) => {
- this.form = response.data;
+ let tempForm = response.data;
this.open = true;
this.title = "修改通用物模型";
// Json转对象
- this.form.specs = JSON.parse(this.form.specs);
+ tempForm.specs = JSON.parse(tempForm.specs);
+ if (!tempForm.specs.enumList) {
+ tempForm.specs.enumList = [{
+ value: "",
+ text: ""
+ }];
+ }
+ if (!tempForm.specs.arrayType) {
+ tempForm.specs.arrayType = "int";
+ }
+ this.form=tempForm;
});
},
/** 提交按钮 */
@@ -445,19 +455,19 @@ export default {
},
/** 切换为枚举项 */
dataTypeChange(val) {
- if (val == "enum") {
- this.form.specs.enumList = [{
- value: "",
- text: ""
- }];
- }
+ // if (val == "enum") {
+ // this.form.specs.enumList = [{
+ // value: "",
+ // text: ""
+ // }];
+ // }
},
/** 添加枚举项 */
addEnumItem() {
this.form.specs.enumList.push({
value: "",
text: ""
- })
+ });
},
/** 删除枚举项 */
removeEnumItem(index) {