From 716ded9c48898ff8fb9e4a1872ccfe676c7f2f99 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期六, 15 四月 2023 16:32:28 +0800 Subject: [PATCH] 代码整合 --- Source/UBCS-WEB/src/views/code/code.vue | 229 ++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 137 insertions(+), 92 deletions(-) diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue index 0a2fa7a..7061014 100644 --- a/Source/UBCS-WEB/src/views/code/code.vue +++ b/Source/UBCS-WEB/src/views/code/code.vue @@ -1,89 +1,96 @@ <template> - <basic-container> + <basic-container style="height: 350px;"> + <!-- 缂栫爜瑙勫垯淇℃伅灞曠ず鍖哄煙 --> - <avue-crud :option="option" - :table-loading="loading" - :data="data" - :page.sync="page" - :permission="permissionList" - v-model="form" - ref="crud" - :before-open="beforeOpen" - @row-update="rowUpdate" - @row-save="rowSave" - @search-change="searchChange" - @search-reset="searchReset" - @selection-change="selectionChange" - @current-change="currentChange" - @size-change="sizeChange" - @refresh-change="refreshChange" - @on-load="onLoad"> - <!-- 琛ㄦ牸鍐呮搷浣滄寜閽� --> - <template slot="menu" slot-scope="scope"> - <el-button type="text" - size="small" - icon="el-icon-edit" - v-show="scope.row.lcStatusText=='缂栬緫涓�' ? true:false" - plain - @click="openEdit(scope.row)">缂� 杈� - </el-button> - <el-button type="text" - size="small" - icon="iconfont iconicon_shakehands" - v-show="scope.row.lcStatusText=='缂栬緫涓�' ? true:false" - plain - @click="enableOrDeactivatse(scope.row.oid,'release')">鍙� 甯� - </el-button> - <el-button type="text" - size="small" - v-show="scope.row.lcStatusText=='宸插彂甯�' ? true:false" - icon="iconfont iconicon_details" - plain - @click="enableOrDeactivatse(scope.row.oid,'disable')">鍋� 鐢� - </el-button> - <el-button type="text" - size="small" - v-show="scope.row.lcStatusText=='鍋滅敤' ? true:false" - icon="iconfont iconicon_task_done" - plain - @click="enableOrDeactivatse(scope.row.oid,'enable')">鍚� 鐢� - </el-button> - </template> - <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� --> - <template slot="menuLeft" slot-scope="scope"> - <el-button type="danger" - size="small" - icon="el-icon-delete" - plain - @click="handleDelete">鍒� 闄� - </el-button> - <el-button size="small" - icon="el-icon-coin" - plain - @click="cloneCodeSetting">鍏� 闅� - </el-button> - <el-button size="small" - icon="el-icon-coine" - plain - @click="handleDelete">浠庡叾浠栬鍒欎腑鍏嬮殕鐮佹 - </el-button> - <el-button size="small" - icon="el-icon-notebook-1" - plain - @click="handleRange">浣跨敤鑼冨洿 - </el-button> - <el-button size="small" - icon="el-icon-notebook-2" - plain - @click="handleDelete">娓呯┖鐮佸�� - </el-button> - </template> - </avue-crud> + <basic-container> + <p style="margin-top: -12px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">缂栫爜瑙勫垯</p> + <avue-crud :option="optionRule" + :table-loading="loading" + :data="data" + :page.sync="page" + :permission="permissionList" + v-model="form" + ref="crud" + :before-open="beforeOpen" + @cell-click="loadBasic" + @row-update="rowUpdate" + @row-save="rowSave" + @search-change="searchChange" + @search-reset="searchReset" + @selection-change="selectionChange" + @current-change="currentChange" + @size-change="sizeChange" + @refresh-change="refreshChange" + @on-load="onLoad"> + <!-- 琛ㄦ牸鍐呮搷浣滄寜閽� --> + <template slot="menu" slot-scope="scope"> + <el-button type="text" + size="small" + icon="el-icon-edit" + v-show="scope.row.lcStatusText=='缂栬緫涓�' ? true:false" + plain + @click="openEdit(scope.row)">缂� 杈� + </el-button> + <el-button type="text" + size="small" + icon="el-icon-position" + v-show="scope.row.lcStatusText=='缂栬緫涓�' ? true:false" + plain + @click="enableOrDeactivatse(scope.row.oid,'release')">鍙� 甯� + </el-button> + <el-button type="text" + size="small" + v-show="scope.row.lcStatusText=='宸插彂甯�' ? true:false" + icon="el-icon-video-pause" + plain + @click="enableOrDeactivatse(scope.row.oid,'disable')">鍋� 鐢� + </el-button> + <el-button type="text" + size="small" + v-show="scope.row.lcStatusText=='鍋滅敤' ? true:false" + icon="el-icon-video-play" + plain + @click="enableOrDeactivatse(scope.row.oid,'enable')">鍚� 鐢� + </el-button> + </template> + <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� --> + <template slot="menuLeft" slot-scope="scope"> + <el-button type="danger" + size="small" + icon="el-icon-delete" + plain + @click="handleDelete">鍒� 闄� + </el-button> + <el-button size="small" + icon="icon-kelong" + plain + @click="cloneCodeSetting">鍏� 闅� + </el-button> + <el-button size="small" + icon="icon-lianjiekelong" + style="font-size: 12px;" + plain + @click="handleDelete">浠庡叾浠栬鍒欎腑鍏嬮殕鐮佹 + </el-button> + <el-button size="small" + icon="el-icon-s-help" + plain + @click="handleRange">浣跨敤鑼冨洿 + </el-button> + <el-button size="small" + icon="icon-qingkong" + plain + @click="handleDelete">娓呯┖鐮佸�� + </el-button> + </template> + </avue-crud> + </basic-container> + <!-- 瀵硅瘽妗� --> <el-dialog title="缂栫爜瑙勫垯浣跨敤鑼冨洿" - append-to-body - :visible.sync="codeRangeSettingBox" - width="800px"> + append-to-body + :visible.sync="codeRangeSettingBox" + width="800px"> <avue-crud :option="dialogeOption" :table-loading="dialogLoading" @@ -92,21 +99,34 @@ </el-dialog> <!-- 鍏嬮殕瀵硅瘽妗� --> <el-dialog title="鍏嬮殕缂栫爜瑙勫垯" - append-to-body - :visible.sync="cloneSettingBox" - width="800px"> + append-to-body + :visible.sync="cloneSettingBox" + width="800px"> <clone-code></clone-code> </el-dialog> - <!-- 鍩虹缂栫爜淇℃伅 --> + <!-- 鍩虹鐮佹灞曠ず鍖哄煙 --> + <basic-container> + <p style="margin-top: -12px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">鐮佹绠$悊</p> + <avue-crud :option="optionBasic" + :table-loading="loadingBasic" + :data="basicData" + :permission="permissionList" + @refresh-change="refreshChange"> + </avue-crud> + </basic-container> </basic-container> + </template> <script> - import {gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus} from "@/api/code/mdmrule"; - import option from "@/const/code/mdmrule"; + import { gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus } from "@/api/code/mdmrule"; + import { gridCodeBasicSec } from "@/api/code/codebasic"; + import optionBasic from "@/const/code/codebasic"; + import optionRule from "@/const/code/mdmrule"; import {mapGetters} from "vuex"; + export default { data() { return { @@ -120,13 +140,21 @@ total: 0 }, selectionList: [], - option: option, + //缂栫爜瑙勫垯琛ㄦ牸閰嶇疆 + optionRule: optionRule, + data: [], - /*浣跨敤鑼冨洿*/ - codeRangeSettingBox: false, - /*鍏嬮殕寮圭獥*/ + /*鍏嬮殕鎸夐挳瀵硅瘽妗嗘帶鍒�*/ cloneSettingBox: false, + optionBasic: optionBasic, + + //鍩虹鐮佹灞曠ず + basicData:[], + loadingBasic: true, + + /*浣跨敤鑼冨洿瀵硅瘽妗嗘帶鍒�*/ + codeRangeSettingBox: false, useRangeData: [], dialogLoading: true, /*浣跨敤鑼冨洿瀵硅瘽妗�*/ @@ -173,6 +201,19 @@ }, }, methods: { + //鐐瑰嚮鍑哄彂鍔犺浇鍩虹鐮佹淇℃伅 + loadBasic(row){ + this.loadingBasic = true; + //console.log(row.oid); + gridCodeBasicSec(1, -1, {"pkCodeRule":row.oid}).then(res => { + const data = res.data.data; + this.basicData = data.records; + //console.log(this.basicData); + this.loadingBasic = false; + }); + + }, + //鏌ヨ浣跨敤鑼冨洿 handleRange(){ if (this.selectionList.length === 0) { @@ -332,6 +373,7 @@ this.page.total = data.total; this.data = data.records; this.loading = false; + this.loadBasic(data.records[0]) this.selectionClear(); }); } @@ -340,4 +382,7 @@ </script> <style> +.icon-lianjiekelong { + font-size: 12px; +} </style> \ No newline at end of file -- Gitblit v1.9.3