|
@@ -53,7 +53,7 @@
|
|
|
>
|
|
|
<el-super-ux-table
|
|
|
index
|
|
|
- v-model="form[item.key]"
|
|
|
+ v-model="innerValue[item.key]"
|
|
|
:dict="dict"
|
|
|
:ref="activeName"
|
|
|
:columns="columns"
|
|
@@ -71,7 +71,7 @@
|
|
|
v-if="openMode !== 'see'"
|
|
|
type="text"
|
|
|
:size="size"
|
|
|
- @click="useRowRemove(scope.$index, scope.row)"
|
|
|
+ @click="useRowRemove(scope)"
|
|
|
>删 行</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -172,6 +172,20 @@ export default {
|
|
|
dimensionalitys() {
|
|
|
return this.form.dimensionalitys.filter(({ delFlag }) => delFlag !== "2");
|
|
|
},
|
|
|
+ innerValue: {
|
|
|
+ get() {
|
|
|
+ const { form } = this;
|
|
|
+ return {
|
|
|
+ ...form,
|
|
|
+ indexs: form.indexs.filter((item) => item.delFlag == "0"),
|
|
|
+ dimensionalitys: form.dimensionalitys.filter(
|
|
|
+ (item) => item.delFlag == "0"
|
|
|
+ ),
|
|
|
+ cycles: form.cycles.filter((item) => item.delFlag == "0"),
|
|
|
+ };
|
|
|
+ },
|
|
|
+ set(value) {},
|
|
|
+ },
|
|
|
},
|
|
|
async created() {},
|
|
|
methods: {
|
|
@@ -317,23 +331,28 @@ export default {
|
|
|
}
|
|
|
this.form[this.activeName].push({
|
|
|
delFlag: "0",
|
|
|
- $index: new Date().getTime(),
|
|
|
...row,
|
|
|
});
|
|
|
- console.log("this.form[this.activeName]", this.form[this.activeName]);
|
|
|
},
|
|
|
//删行
|
|
|
- async useRowRemove(index, row) {
|
|
|
- if (row.id) {
|
|
|
- this.form[this.activeName].forEach((e) => {
|
|
|
- if (e.id == row.id) {
|
|
|
+ async useRowRemove(scope) {
|
|
|
+ const {
|
|
|
+ rowid,
|
|
|
+ row: { id, _XID },
|
|
|
+ } = scope;
|
|
|
+ const { activeName } = this;
|
|
|
+
|
|
|
+ if (id) {
|
|
|
+ this.form[activeName].forEach((e) => {
|
|
|
+ if (e.id == id) {
|
|
|
e.delFlag = "2";
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- this.form[this.activeName].splice(index, 1);
|
|
|
+ this.form[activeName] = this.form[activeName].filter(
|
|
|
+ (item) => item._XID != _XID
|
|
|
+ );
|
|
|
}
|
|
|
- console.log("this.form[this.activeName]", this.form[this.activeName]);
|
|
|
},
|
|
|
//切换多页签
|
|
|
useSwitchTab() {},
|