From 1988d77f4df3c01a9137303e0c959b3442c14377 Mon Sep 17 00:00:00 2001 From: lzhe <lzhe@example.com> Date: 星期一, 30 九月 2024 22:10:30 +0800 Subject: [PATCH] 1 --- src/views/mdc/configComp/Status.vue | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/views/mdc/configComp/Status.vue b/src/views/mdc/configComp/Status.vue index 8fe0650..331f075 100644 --- a/src/views/mdc/configComp/Status.vue +++ b/src/views/mdc/configComp/Status.vue @@ -1,13 +1,14 @@ <!-- * @Date: 2024-04-17 18:53:45 - * @LastEditors: Sneed - * @LastEditTime: 2024-04-18 19:42:24 - * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Status.vue + * @LastEditors: gaosp + * @LastEditTime: 2024-09-19 21:45:01 + * @FilePath: /mdc/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Status.vue --> <template> <el-main> <el-row> - <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete dragSort @rowDrop="save"> + <!-- dragSort --> + <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete dragSort @rowDrop="rowDrop"> <el-table-column label="宸ヤ綅/鏈哄櫒鐘舵��" prop="name"></el-table-column> <el-table-column label="缂栧彿" prop="code"></el-table-column> <el-table-column label="棰滆壊" prop="color"></el-table-column> @@ -34,8 +35,10 @@ </el-table-column> </scFormTable> </el-row> - <el-row style="margin-top: 20px;"> - <scFormTable ref="table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate" dragSort> + <el-row style="margin-top: 20px;position: relative"> + <!-- dragSort --> + <scFormTable ref=" table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate" + @rowDrop="rowDrop" dragSort hideDelete> <el-table-column label="浜哄伐鍙嶉鐘舵��" prop="name"> <template #default="scope"> <el-input v-model="scope.row.name" @change="update(scope.row)"></el-input> @@ -64,6 +67,11 @@ </el-table-column> <el-table-column label="鎿嶄綔" prop="state"> <template #default="scope"> + <el-popconfirm title="纭畾鍒犻櫎鍚楋紵" @confirm="rowDel(scope.row, scope.$index)"> + <template #reference> + <el-button type="danger" icon="el-icon-delete" size="small" plain circle></el-button> + </template> + </el-popconfirm> <el-button v-show="scope.row.isNew" @click="add(scope.row)">淇濆瓨</el-button> </template> </el-table-column> @@ -167,6 +175,11 @@ this.getList() }, methods: { + rowDel(row, index) { + // this.$emit('delRow', row) + this.remove(row) + this.data.splice(index, 1) + }, getList() { this.$HTTP.get('/api/blade-cps/global_wcs/wcs-achievements').then(res => { if (res.code === 200) { @@ -207,6 +220,9 @@ if (!row.code || !row.color || !row.name) { return this.$message.warning('鐘舵�佸悕绉般�佺紪鍙枫�侀鑹插繀濉�'); (`鎿嶄綔鎴愬姛`) } + if (isNaN(row.code) || row.code < 1 || row.code > 99) { + return this.$message.warning('缂栧彿鑼冨洿涓�1锝�99'); + } let data = { code: row.code, color: row.color, @@ -229,6 +245,16 @@ this.getList() } }) + }, + rowDrop(arr) { + this.$HTTP.post(`/api/blade-cps/global_wcs/update-wcs-seq`, arr.map(v => v.code)).then(res => { + if (res.success) { + this.$message.success(res.msg) + } else { + this.$message.success(res.msg) + } + }) + console.log(arr) } } } -- Gitblit v1.9.3