From dfd77a2f5f905e27216b87d207f9fe8c4035e797 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 24 七月 2024 18:21:19 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue | 409 +++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 263 insertions(+), 146 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue index 3335d16..67688b6 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue @@ -1,138 +1,222 @@ <template> - <basic-container> - <avue-crud - ref="userCrud" - :data="tableData" - :option="option" - :table-loading="tableLoading" - @on-load="getTableList" - @refresh-change="handleRefresh" - @search-change="handleSearch" - @search-reset="handleReset" - @selection-change="selectChange" - @row-click="rowClickHandler" - > + <el-container> + <el-main> + <basic-container> + <avue-crud + ref="userCrud" + :data="tableData" + :option="option" + :table-loading="tableLoading" + @on-load="getTableList" + @refresh-change="handleRefresh" + @search-change="handleSearch" + @search-reset="handleReset" + @selection-change="selectChange" + @row-click="rowClickHandler" + > - <template slot="menuLeft" slot-scope="scope"> - <el-button icon="el-icon-plus" size="small" type="primary" @click="rowSaveHandlerClick">鍒涘缓</el-button> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button> - <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅浣跨敤鑼冨洿</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">涓嬭浇瀵煎叆妯℃澘</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">瀵煎嚭</el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">瀵煎叆</el-button> - </template> + <template slot="menuLeft" slot-scope="scope"> + <el-button icon="el-icon-plus" size="small" type="primary" @click="rowSaveHandlerClick">鍒涘缓</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button> + <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅浣跨敤鑼冨洿</el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">涓嬭浇瀵煎叆妯℃澘 + </el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">瀵煎嚭</el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">瀵煎叆</el-button> + </template> - <template slot="menu" slot-scope="scope"> - <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫 - </el-button> - <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎 - </el-button> - </template> + <template slot="menu" slot-scope="scope"> + <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫 + </el-button> + <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎 + </el-button> + </template> - </avue-crud> - <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> - <el-dialog - v-dialogDrag - v-loading="dialogLoading" - :title="dialogType === 'add' ? ' 鍒涘缓' : '缂栬緫'" - :visible.sync="dialogVisible" - append-to-body="true" - class="avue-dialog" - width="70%" - @close="dialogClose" - > - <el-form ref="form" :model="form" :rules="rules" label-width="80px"> - <el-row> - <el-col :span="12"> - <el-form-item label="鍚嶇О锛�" prop="id"> - <el-input v-model="form.id"></el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="鏍囩锛�"> - <el-input v-model="form.name"></el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="绫诲瀷锛�"> - <el-select v-model="form.enumValueDataType" placeholder="璇烽�夋嫨绫诲瀷"> - <el-option label="String" value="String"></el-option> - <el-option label="Integer" value="Integer"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="闀垮害锛�"> - <el-input-number v-model="form.length" :max="999" :min="1" label="鎻忚堪鏂囧瓧"></el-input-number> - </el-form-item> - </el-col> - <el-col :span="24"> - <avue-crud - ref="dialogCrud" - :data="dialogData" - :option="dialogOption" - @row-save="rowSaveDialogHandler" - @row-update="rowUpdateDialogHandler" - @row-del="rowDeleteDialogHandler" - > - </avue-crud> - </el-col> - </el-row> - </el-form> + </avue-crud> + <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> + <el-dialog + v-dialogDrag + v-loading="dialogLoading" + :title="dialogType === 'add' ? ' 鍒涘缓' : '缂栬緫'" + :visible.sync="dialogVisible" + append-to-body="true" + class="avue-dialog" + width="70%" + @close="dialogClose" + > + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-row> + <el-col :span="12"> + <el-form-item label="鍚嶇О锛�" prop="id"> + <el-input v-model="form.id"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鏍囩锛�"> + <el-input v-model="form.name"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="绫诲瀷锛�"> + <el-select v-model="form.enumValueDataType" placeholder="璇烽�夋嫨绫诲瀷"> + <el-option label="String" value="String"></el-option> + <el-option label="Integer" value="Integer"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="闀垮害锛�"> + <el-input-number v-model="form.length" :max="999" :min="1" label="鎻忚堪鏂囧瓧"></el-input-number> + </el-form-item> + </el-col> + <el-col :span="24"> + <avue-crud + ref="dialogCrud" + :data="dialogData" + :option="dialogOption" + @row-save="rowSaveDialogHandler" + @row-update="rowUpdateDialogHandler" + @row-del="rowDeleteDialogHandler" + > + </avue-crud> + </el-col> + </el-row> + </el-form> - <span slot="footer" class="dialog-footer"> + <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="rowSaveHandler">纭� 瀹�</el-button> <el-button @click="dialogVisible = false">鍙� 娑�</el-button> </span> - </el-dialog> + </el-dialog> - <!-- 鏌ョ湅浣跨敤鑼冨洿 --> - <el-dialog - v-dialogDrag - v-loading="checkViewLoading" - title="鏌ョ湅浣跨敤鑼冨洿" - :visible.sync="checkViewVisible" - append-to-body="true" - class="avue-dialog" - width="70%" - > - <avue-crud - ref="checkViewCrud" - :data="checkViewData" - :option="checkViewOption" - @search-change="checkHandleSearch" - @search-reset="checkHandleReset" - > + <!-- 鏌ョ湅浣跨敤鑼冨洿 --> + <el-dialog + v-dialogDrag + v-loading="checkViewLoading" + :visible.sync="checkViewVisible" + append-to-body="true" + class="avue-dialog" + title="鏌ョ湅浣跨敤鑼冨洿" + width="70%" + > + <avue-crud + ref="checkViewCrud" + :data="checkViewData" + :option="checkViewOption" + @search-change="checkHandleSearch" + @search-reset="checkHandleReset" + > - </avue-crud> - </el-dialog> + </avue-crud> + </el-dialog> - <!--瀵煎叆 --> - <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" title="瀵煎叆" @updata="getTableList"></upload-file> - </basic-container> + <!--瀵煎叆 --> + <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆" + @updata="getTableList"></upload-file> + </basic-container> + </el-main> + + <el-aside width="30%"> + <basic-container> + <el-descriptions :column="1" border size="medium" style="margin-bottom: 20px" title="鏋氫妇淇℃伅"> + <el-descriptions-item> + <template slot="label"> + 鍚嶇О + </template> + {{ this.lastItem.id }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + 鏍囩 + </template> + {{ this.lastItem.name }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + 绫诲瀷 + </template> + {{ this.lastItem.enumValueDataType || 'String' }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + 闀垮害 + </template> + <el-tag> {{ this.lastItem.length || 50 }}</el-tag> + </el-descriptions-item> + + </el-descriptions> + + <p style="font-weight: bold">鏋氫妇椤�</p> + <avue-crud + :data="asideData" + :option="asideOption" + > + </avue-crud> + </basic-container> + </el-aside> + </el-container> </template> <script> import basicOption from '@/util/basic-option' -import {getEnumTypeList, addEnumType, updateEnumType, deleteEnumTypes,getUsedEnumList,download,downloadEnumTemplate} from "@/api/modeling/enumType/api"; +import { + getEnumTypeList, + addEnumType, + updateEnumType, + deleteEnumTypes, + getUsedEnumList, + download, + downloadEnumTemplate +} from "@/api/modeling/enumType/api"; import func from "@/util/func"; +import {deleteUser} from "@/api/system/user/api"; export default { name: "index", data() { return { - tipList:["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」","*娉ㄦ剰*:绗簩琛屽紑濮嬬殑鏁版嵁涓虹ず渚嬫暟鎹紝瀵煎叆鍓嶈灏嗗叾鍒犻櫎锛屽綋瀵煎叆鐨勬灇涓句笅鍏峰澶氫釜鏋氫妇椤规椂锛屽簲鎸夌収绀轰緥enum2鐨勫啓娉�", - "鏋氫妇椤瑰悕绉�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)","鏋氫妇鍊�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)"], + asideOption: { + ...basicOption, + addBtn: false, + editBtn: false, + menu: false, + refreshBtn: false, + selection: false, + index: false, + column: [ + { + label: '鏋氫妇椤瑰悕绉�', + prop: 'name', + sortable: true, + }, + { + label: '鏋氫妇鍊�', + prop: 'value', + sortable: true, + }, + { + label: '鎻忚堪', + prop: 'description', + }, + ] + }, + tipList: [ + "瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」", + "*娉ㄦ剰*:绗簩琛屽紑濮嬬殑鏁版嵁涓虹ず渚嬫暟鎹紝瀵煎叆鍓嶈灏嗗叾鍒犻櫎锛屽綋瀵煎叆鐨勬灇涓句笅鍏峰澶氫釜鏋氫妇椤规椂锛屽簲鎸夌収绀轰緥enum2鐨勫啓娉�", + "鏋氫妇椤瑰悕绉�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)", + "鏋氫妇鍊�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)", + "瀵煎叆涓�涓灇涓句笅鐨勫涓灇涓鹃」鏃讹紝璇峰皢鏋氫妇鍚嶃�佹爣绛俱�佽繑鍥炵被鍨嬨�佺瓑淇℃伅濉啓涓�鑷达紝鍐嶅~鍐欎笉鍚岀殑鏋氫妇椤�" + ], upFileType: ['xls', 'xlsx'], fileUrl: 'api/webEnumController/importEnumTypes', - checkViewOption:{ + checkViewOption: { ...basicOption, - addBtn:false, - menu:false, + addBtn: false, + menu: false, searchMenuSpan: 8, refreshBtn: false, - selection:false, - column:[ + selection: false, + column: [ { label: '鍚嶇О', prop: 'enumName', @@ -142,7 +226,7 @@ label: '鏉ユ簮', prop: 'source', sortable: true, - search:true + search: true }, { label: '璇存槑', @@ -150,10 +234,10 @@ } ] }, - checkViewData:[], - checkViewDataSearch:[], - checkViewVisible:false, - checkViewLoading:false, + checkViewData: [], + checkViewDataSearch: [], + checkViewVisible: false, + checkViewLoading: false, editRow: {}, dialogType: '', dialogData: [], @@ -220,7 +304,7 @@ label: '鏋氫妇鍚嶇О', prop: 'id', sortable: true, - search:true + search: true }, { label: '鏍囩', @@ -236,7 +320,15 @@ }, tableLoading: false, selectList: [], - searchParams:{} + searchParams: {} + } + }, + computed: { + lastItem() { + return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {}; + }, + asideData() { + return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1].items : []; } }, methods: { @@ -258,9 +350,9 @@ }, // 鎼滅储 - handleSearch(params,done) { + handleSearch(params, done) { this.searchParams = { - enumName:params.id + enumName: params.id }; this.getTableList() done(); @@ -274,6 +366,7 @@ // 閫夋嫨妗� selectChange(row) { + console.log(row) this.selectList = row; }, @@ -314,7 +407,6 @@ this.dialogData = row.items; this.dialogVisible = true; this.editRow = row; - console.log(row); }, // 鍒犻櫎鎸夐挳鐐瑰嚮 @@ -325,29 +417,53 @@ ts: row.ts } let data = [params]; - deleteEnumTypes(data).then(res => { - if (res.data.code === 200) { - this.$message.success(res.data.obj); - this.getTableList(); - } - }) + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎褰撳墠鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteEnumTypes(data).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.obj); + this.getTableList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); }, // 澶氶�夊垹闄� allDelHandler() { let data = this.selectList.map(item => { - return{ + return { oid: item.oid, name: item.id, ts: item.ts } }) - deleteEnumTypes(data).then(res => { - if (res.data.code === 200) { - this.$message.success(res.data.obj); - this.getTableList(); - } - }) + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteEnumTypes(data).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.obj); + this.getTableList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + + }, // 瀵硅瘽妗嗘灇涓句繚瀛� @@ -473,18 +589,18 @@ }, // 鏌ョ湅浣跨敤鑼冨洿 - chekView(){ - if(this.selectList.length <= 0 ){ + chekView() { + if (this.selectList.length <= 0) { this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); return; } - if(this.selectList.length >1 ){ + if (this.selectList.length > 1) { this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹繘琛屾煡鐪�'); return; } - getUsedEnumList({enumName:this.selectList[0].id}).then(res => { - if(res.data.code === 200){ + getUsedEnumList({enumName: this.selectList[0].id}).then(res => { + if (res.data.code === 200) { this.checkViewVisible = true; this.checkViewData = res.data.data; this.checkViewDataSearch = res.data.data; @@ -494,12 +610,13 @@ // 鏌ョ湅浣跨敤鑼冨洿鏌ヨ checkHandleSearch(params, done) { - const { source } = params; + const {source} = params; - if(!params.source) { + if (!params.source) { this.checkViewData = this.checkViewDataSearch; return done(); - }; + } + ; this.checkViewData = this.checkViewData.filter(item => { return item.source && item.source.includes(source); @@ -510,19 +627,19 @@ }, // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆 - checkHandleReset(){ + checkHandleReset() { this.checkViewData = this.checkViewDataSearch; }, // 瀵煎嚭 - downloadHandler(){ - if(this.selectList.length <= 0 ){ + downloadHandler() { + if (this.selectList.length <= 0) { this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹繘琛屽鍑�'); return; } let enumNames = this.selectList.map(item => item.id).join(','); - download({enumNames:enumNames}).then(res => { + download({enumNames: enumNames}).then(res => { func.downloadFileByBlobHandler(res); this.$message.success('瀵煎嚭鎴愬姛'); }).catch(err => { @@ -531,7 +648,7 @@ }, // 涓嬭浇瀵煎叆妯℃澘 - downloadTemplateHandler(){ + downloadTemplateHandler() { downloadEnumTemplate().then(res => { func.downloadFileByBlobHandler(res); this.$message.success('涓嬭浇鎴愬姛'); @@ -540,7 +657,7 @@ }) }, - uploadUser(){ + uploadUser() { this.$refs.upload.visible = true; } } -- Gitblit v1.9.3