From d5894106a09ea9bc900bad176c177763a1df0568 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期五, 27 十二月 2024 14:29:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue | 120 +++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 75 insertions(+), 45 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
index 2e39321..5552afc 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
@@ -2,10 +2,10 @@
<basic-container>
<avue-crud
ref="useCrud"
- :table-loading="loading"
:data="data"
:option="option"
:page.sync="page"
+ :table-loading="loading"
@selection-change="selectChange"
@row-click="rowClickHandler"
@refresh-change="handleRefresh"
@@ -13,27 +13,30 @@
@current-change="currentChange"
>
<template slot="menuLeft">
- <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓
+ <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓
</el-button>
- <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">鍒犻櫎
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">鍒犻櫎
</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+ <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
+ <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
</el-button>
- <el-button icon="el-icon-check" plain size="small" type="primary"
- @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿
+ <el-button v-if="permissionList.viewTheScopeBtn" icon="el-icon-view" plain size="small" type="primary" @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿
</el-button>
</template>
<template slot="menu" slot-scope="{row,index}">
- <el-button icon="el-icon-edit" plain size="small" type="text" @click="editClickHandler(row)">淇敼
+ <el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="text" @click="editClickHandler(row)">淇敼
</el-button>
- <el-button icon="el-icon-delete" plain size="small" type="text" @click="delRowClickHandler(row)">鍒犻櫎
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="text" @click="delRowClickHandler(row)">鍒犻櫎
</el-button>
</template>
-
+ <template #icon="{ row }">
+ <span class="avue-icon">
+ <icon-show :name="row.imagePath"></icon-show>
+ </span>
+ </template>
</avue-crud>
<!-- 鏂板 淇敼 -->
@@ -43,10 +46,10 @@
:visible.sync="visible"
append-to-body="true"
class="avue-dialog"
- width="40%"
+ width="500px"
@close="visibleCloseHandler"
>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px" size="small">
<el-row>
<el-col :span="24">
<el-form-item label="鍚嶇О锛�" prop="id">
@@ -59,6 +62,12 @@
</el-form-item>
</el-col>
<el-col :span="24">
+ <el-form-item label="鍥炬爣锛�" prop="imagePath">
+ <input-icon v-model="form.imagePath" placeholder="璇烽�夋嫨鍥炬爣">
+ </input-icon>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
<el-form-item label="鎻忚堪锛�" prop="description">
<el-input v-model="form.description" :rows="2" type="textarea"></el-input>
</el-form-item>
@@ -66,14 +75,14 @@
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
- <el-button @click="visibleCloseHandler">鍙� 娑�</el-button>
- <el-button type="primary" @click="addSaveHandler">纭� 瀹�</el-button>
+ <el-button size="small" type="primary" @click="addSaveHandler">纭� 瀹�</el-button>
+ <el-button size="small" @click="visibleCloseHandler">鍙� 娑�</el-button>
</span>
</el-dialog>
<!-- 瀵煎叆 -->
<upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
- @updata="getTreeList"></upload-file>
+ @updata="getList"></upload-file>
<!-- 鏌ョ湅浣跨敤鑼冨洿 -->
<el-dialog
@@ -95,19 +104,19 @@
</avue-crud>
</el-dialog>
</basic-container>
-
</template>
<script>
import {gridStatus, addSave, editSave, deleteStatus, exportStatus, listUsed} from "@/api/modeling/statusPool/api";
import func from "@/util/func";
import basicOption from "@/util/basic-option";
+import {mapGetters} from "vuex";
export default {
name: "index",
data() {
return {
- loading:false,
+ loading: false,
data: [],
option: {
...basicOption,
@@ -120,6 +129,10 @@
label: '鍚嶇О',
prop: 'id',
sortable: true,
+ },
+ {
+ label: '鍥炬爣',
+ prop: 'icon'
},
{
label: '鏍囩',
@@ -143,6 +156,7 @@
searchMenuSpan: 8,
refreshBtn: false,
selection: false,
+ header:false,
column: [
{
label: '鍚嶇О',
@@ -178,8 +192,8 @@
]
},
visible: false,
- selectList:[],
- lastIndex:null,
+ selectList: [],
+ lastIndex: null,
page: {
currentPage: 1,
pageSize: 15,
@@ -188,42 +202,52 @@
},
}
},
+ computed:{
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+ delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+ editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+ exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+ importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+ viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].viewTheScope, false),
+ };
+ },
+ },
created() {
- this.getTreeList();
+ this.getList();
},
methods: {
- // 宸︿晶鏍戣姹�
- getTreeList() {
+ getList() {
gridStatus(this.page.currentPage, this.page.pageSize).then(res => {
const data = res.data.data;
this.data = data;
this.page.total = res.data.total;
this.loading = false;
- }).catch(err => {
- this.$message.error(err)
});
},
// 琛ㄦ牸鍒锋柊
- handleRefresh(){
- this.getTreeList();
+ handleRefresh() {
+ this.getList();
},
// 琛ㄦ牸澶氶��
- selectChange(row){
+ selectChange(row) {
this.selectList = row;
},
// 鏉℃暟
sizeChange(val) {
this.page.pageSize = val;
- this.getTreeList();
+ this.getList();
},
// 椤电爜
currentChange(val) {
this.page.currentPage = val;
- this.getTreeList();
+ this.getList();
},
// 琛屽崟閫�
@@ -232,8 +256,12 @@
row,
this.$refs.useCrud,
this.lastIndex,
- (newIndex) => { this.lastIndex = newIndex; },
- () => { this.selectList = []; }
+ (newIndex) => {
+ this.lastIndex = newIndex;
+ },
+ () => {
+ this.selectList = [];
+ }
);
},
@@ -265,7 +293,7 @@
deleteStatus(this.selectList).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
- this.getTreeList();
+ this.getList();
}
})
}).catch(() => {
@@ -277,7 +305,7 @@
},
// 琛屽崟涓垹闄�
- delRowClickHandler(row){
+ delRowClickHandler(row) {
this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
@@ -288,7 +316,7 @@
deleteStatus(list).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
- this.getTreeList();
+ this.getList();
}
})
}).catch(() => {
@@ -315,18 +343,21 @@
// 鍒涘缓鎴栫紪杈戜繚瀛�
addSaveHandler() {
const saveFunction = this.dialogTitle === 'add' ? addSave : editSave;
-
- saveFunction(this.form).then(res => {
- if (res.data.code === 200) {
- this.$message.success(res.data.obj);
- this.loading = true;
- this.getTreeList();
- this.visible = false;
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ saveFunction(this.form).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.loading = true;
+ this.getList();
+ this.visible = false;
+ } else {
+ this.$message.error(res.data.obj);
+ }
+ })
} else {
- this.$message.error(res.data.obj);
+ return false;
}
- }).catch(error => {
- this.$message.error(error);
});
},
@@ -382,7 +413,6 @@
this.checkViewData = this.checkViewDataSearch;
return done();
}
- ;
this.checkViewData = this.checkViewData.filter(item => {
return item.name && item.name.includes(name);
--
Gitblit v1.9.3