From 0bf020909308ba897c4cc20c73f9ac72cc8d9bf4 Mon Sep 17 00:00:00 2001 From: lzhe <181968431@qq.com> Date: 星期一, 03 六月 2024 00:10:25 +0800 Subject: [PATCH] 1 --- src/views/configuration/custom/planSettings.vue | 128 ++++++++++++++++++--- src/layout/components/userbar.vue | 3 src/views/configuration/custom/saveSelectDialog.vue | 130 +++++++++++++++++++++ src/config/route.js | 11 + src/views/notification/notice/newsmail.vue | 78 +++++++++++++ 5 files changed, 331 insertions(+), 19 deletions(-) diff --git a/src/config/route.js b/src/config/route.js index a25a9dc..83bc1d1 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -77,6 +77,17 @@ type: 'menu', hidden: true } + }, + { + name: "娑堟伅涓績", + path: "/notification/notice/newsmail", + component: "notification/notice/newsmail", + meta: { + icon: "el-icon-menu", + title: "娑堟伅涓績", + type: 'menu', + hidden: true + } } ] diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 133f4cc..9799825 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -166,7 +166,8 @@ }, //鏄剧ず鐭秷鎭� showMsg(){ - this.msg = true + //this.msg = true + this.$router.push({path: '/notification/notice/newsmail'}); }, //鏍囪宸茶 markRead(){ diff --git a/src/views/configuration/custom/planSettings.vue b/src/views/configuration/custom/planSettings.vue index a82571e..a1673a6 100644 --- a/src/views/configuration/custom/planSettings.vue +++ b/src/views/configuration/custom/planSettings.vue @@ -8,7 +8,7 @@ --> <template> <div class="aposcope-main"> - <div class="header"> + <div class="header" v-if="$route.query.type == 1"> <div class="title">璁″垝鏄剧ず璁剧疆</div> <div class="type"> <div class="item last" @click="openPlan">鏂板缓璁″垝绫诲瀷妯$増</div> @@ -24,69 +24,119 @@ </div> </div> </div> - <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> + <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick"> <el-tab-pane label="鏂板缓椤佃缃�" name="first"> <div> - <div class="add-field">+ 娣诲姞瀛楁</div> + <div class="add-field" @click="openSelect">+ 娣诲姞瀛楁</div> <div class="field-title">鍩虹瀛楁</div> <el-table ref="multipleTableRef" :data="tableData0" border style="width: 100%" class="multipleTableRef"> <el-table-column prop="fieldName" label="瀛楁鍚�"></el-table-column> <el-table-column prop="fieldDescription" label="鎻愮ず鏂囧瓧"></el-table-column> <el-table-column prop="defaultValue" label="榛樿鍊�"></el-table-column> - <el-table-column prop="mustField" label="鏄惁蹇呭~"></el-table-column> + <el-table-column prop="mustField" label="鏄惁蹇呭~"> + <template #default="scope"> + <span>{{scope.row.mustField == '1'?"鏄�": "鍚�"}}</span> + </template> + </el-table-column> <el-table-column fixed="right" label="鎿嶄綔"> <template #default="scope"> - <el-button text type="primary" :disabled="scope.row.systemFieldLabel == '鏄�'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> + <el-button text type="primary" :disabled="scope.row.mustField == '1'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + <div class="field-title">鎵╁睍瀛楁</div> + <el-table ref="multipleTableRef" :data="tableData0extend" border style="width: 100%" class="multipleTableRef"> + <el-table-column prop="fieldName" label="瀛楁鍚�"></el-table-column> + <el-table-column prop="fieldDescription" label="鎻愮ず鏂囧瓧"></el-table-column> + <el-table-column prop="defaultValue" label="榛樿鍊�"></el-table-column> + <el-table-column prop="mustField" label="鏄惁蹇呭~"> + <template #default="scope"> + <span>{{scope.row.mustField == '1'?"鏄�": "鍚�"}}</span> + </template> + </el-table-column> + <el-table-column fixed="right" label="鎿嶄綔"> + <template #default="scope"> + <el-button text type="primary" :disabled="scope.row.mustField == '1'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> </div> </el-tab-pane> <el-tab-pane label="缂栬緫椤佃缃�" name="second"> - <div class="add-field">+ 娣诲姞瀛楁</div> + <div class="add-field" @click="openSelect">+ 娣诲姞瀛楁</div> <div class="field-title">鍩虹瀛楁</div> <el-table ref="multipleTableRef" :data="tableData1" border style="width: 100%" class="multipleTableRef"> <el-table-column prop="fieldName" label="瀛楁鍚�"></el-table-column> - <el-table-column prop="fieldDescription" label="鏀寔缂栬緫"></el-table-column> + <el-table-column label="鏀寔缂栬緫" prop="supportUpdateLabel"></el-table-column> <el-table-column fixed="right" label="鎿嶄綔"> <template #default="scope"> - <el-button text type="primary" :disabled="scope.row.systemFieldLabel == '鏄�'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> + <el-button text type="primary" :disabled="scope.row.mustField == '1'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> <div class="field-title">鎵╁睍瀛楁</div> + <el-table ref="multipleTableRef" :data="tableData1extend" border style="width: 100%" class="multipleTableRef"> + <el-table-column prop="fieldName" label="瀛楁鍚�"></el-table-column> + <el-table-column prop="supportUpdateLabel" label="鏀寔缂栬緫"></el-table-column> + <el-table-column fixed="right" label="鎿嶄綔"> + <template #default="scope"> + <el-button text type="primary" :disabled="scope.row.mustField == '1'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> </el-tab-pane> <el-tab-pane label="鏌ョ湅椤佃缃�" name="third"> + <div class="add-field" @click="openSelect">+ 娣诲姞瀛楁</div> <div class="field-title">鍩虹瀛楁</div> <el-table ref="multipleTableRef" :data="tableData2" border style="width: 100%" class="multipleTableRef"> <el-table-column prop="fieldName" label="瀛楁鍚�"></el-table-column> <el-table-column fixed="right" label="鎿嶄綔"> <template #default="scope"> - <el-button text type="primary" :disabled="scope.row.systemFieldLabel == '鏄�'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> + <el-button text type="primary" :disabled="scope.row.sysFieldMust == '1'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> <div class="field-title">鎵╁睍瀛楁</div> + <el-table ref="multipleTableRef" :data="tableData2extend" border style="width: 100%" class="multipleTableRef"> + <el-table-column prop="fieldName" label="瀛楁鍚�"></el-table-column> + <el-table-column fixed="right" label="鎿嶄綔"> + <template #default="scope"> + <el-button text type="primary" :disabled="scope.row.sysFieldMust == '1'?true: false" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> </el-tab-pane> </el-tabs> </div> + <!-- 鏂板缓璁″垝 --> <save-dialog v-if="dialog.save" ref="saveDialog" @success="addPlanSuccess" @closed="dialog.save=false"></save-dialog> + <!-- 娣诲姞瀛楁 --> + <save-select-dialog v-if="dialog.saveSelect" ref="saveSelectDialog" @success="addSelectSuccess" @closed="dialog.saveSelect=false" @addExtend="addExtend"></save-select-dialog> + <!-- 娣诲姞鎵╁睍瀛楁 --> + <save-extend-dialog v-if="dialog.extendSave" ref="saveExtendDialog" @success="addExtendSuccess" @closed="dialog.save=false"></save-extend-dialog> </template> <script> import saveDialog from './addPlan' + import saveSelectDialog from './saveSelectDialog' + import saveExtendDialog from './addField' export default { name: "custom", data(){ return { id: "", dialog: { - save: false + save: false, //鏂板妯$増 + saveSelect: false, //娣诲姞瀛楁 + extendSave: false //娣诲姞鎵╁睍瀛楁 }, planData: [], activeName: "first", + configType: 1, tableData0: [], tableData1: [], - tableData2: [] + tableData2: [], + tableData0extend: [], + tableData1extend: [] } }, created(){ @@ -97,7 +147,7 @@ this.gitProduct(); }, components: { - saveDialog + saveDialog,saveSelectDialog,saveExtendDialog }, methods: { gitProduct() { @@ -126,9 +176,19 @@ this.getTableList(); }, getTableList() { - this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=1&templateId=${this.id}`).then(res=> { + this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=${this.configType}&templateId=${this.id}`).then(res=> { if(res.code == 200) { - this.tableData0 = res.data.systemFieldList; + if(this.activeName == "first") { + this.tableData0 = res.data.systemFieldList; + this.tableData0extend = res.data.customFieldList || []; + }else if(this.activeName == "second") { + this.tableData1 = res.data.systemFieldList; + this.tableData1extend = res.data.customFieldList || []; + }else if(this.activeName == "third") { + this.tableData2 = res.data.systemFieldList; + this.tableData2extend = res.data.customFieldList || []; + } + } }) }, @@ -152,14 +212,46 @@ this.$refs.saveDialog.open(this.productList,this.planData) }) }, + openSelect() { + this.dialog.saveSelect = true + this.$HTTP.get(`/api/blade-system/custom-template-field/getSelectBox?configType=${this.configType}&templateId=${this.id}`).then(res=> { + if(res.code == 200) { + this.$refs.saveSelectDialog.open(res.data,this.id,this.configType); + } + }) + }, addPlanSuccess() { this.getBaseData(); }, - table_del(row,index) { - + addSelectSuccess() { + this.getTableList(); }, - handleClick(text) { - + addExtendSuccess() { + this.getTableList(); + }, + addExtend() { + this.dialog.extendSave = true + this.$nextTick(() => { + this.$refs.saveExtendDialog.open(); + }) + }, + table_del(row,index) { + this.$HTTP.delete(`/api/blade-system/custom-template-field-relation/remove`,[row.id]).then(res=> { + if(res.code == 200) { + this.$message.success("鎿嶄綔鎴愬姛"); + this.getTableList(); + } + }) + }, + handleClick(TabPaneName) { + if(TabPaneName == "first") { + this.configType = 1; + }else if(TabPaneName == "second") { + this.configType = 2; + }else if(TabPaneName == "third") { + this.configType = 3; + } + this.getTableList(); } } } diff --git a/src/views/configuration/custom/saveSelectDialog.vue b/src/views/configuration/custom/saveSelectDialog.vue new file mode 100644 index 0000000..e40dc22 --- /dev/null +++ b/src/views/configuration/custom/saveSelectDialog.vue @@ -0,0 +1,130 @@ +<template> + <el-dialog :title="titleMap[mode]" v-model="visible" :width="700" destroy-on-close @closed="$emit('closed')"> + <div class="field-title">鍩虹瀛楁</div> + <el-checkbox-group v-model="checkListData"> + <el-checkbox v-for="item in checkList" :label="item.fieldName" :disabled="item.sysFieldMust == 1?true:false" /> + </el-checkbox-group> + <div class="field-title"> + 鎵╁睍瀛楁 + <span class="add-field" @click="openSelect">+ 娣诲姞瀛楁</span> + </div> + <el-checkbox-group v-model="extendListData" v-if="extendCheckList.length > 0"> + <el-checkbox v-for="item in extendCheckList" :label="item.fieldName" :disabled="item.sysFieldMust == 1?true:false" /> + </el-checkbox-group> + <template #footer> + <el-button @click="visible=false">鍙栨秷</el-button> + <el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="selectSubmit">纭畾</el-button> + </template> + </el-dialog> +</template> + +<script> + export default { + emits: ['success', 'closed'], + data() { + return { + id: "", + configType: "", + checkListData: [], + checkList: [], + extendListData: [], + extendCheckList: [], + mode: "add", + titleMap: { + add: '娣诲姞瀛楁', + edit: '淇敼', + show: '鏌ョ湅' + }, + visible: false, + isSaveing: false, + } + }, + mounted() { + + }, + components: { + + }, + methods: { + openSelect() { + this.$emit('addExtend', true); + this.visible = false; + }, + //鏄剧ず + open(data,id,configType,mode='add'){ + this.mode = mode; + this.visible = true; + this.checkList = data.systemFieldList || []; + this.extendCheckList = data.customFieldList || []; + this.checkList.forEach(item=> { + if(item.sort !=null) { + this.checkListData.push(item.fieldName); + } + }) + this.extendCheckList.forEach(item=> { + if(item.sort !=null) { + this.extendListData.push(item.fieldName); + } + }) + this.id = id; + this.configType = configType; + return this + }, + //琛ㄥ崟鎻愪氦鏂规硶 + selectSubmit(){ + var list = []; + this.checkList.forEach(item=> { + this.checkListData.forEach(item1=> { + if(item.fieldName == item1) { + list.push(item.fieldId); + } + }) + }) + this.extendCheckList.forEach(item=> { + this.extendListData.forEach(item1=> { + if(item.fieldName == item1) { + list.push(item.fieldId); + } + }) + }) + var obj ={ + businessType: this.$route.query.type, + configType: this.configType, + fieldList: list, + templateId: this.id + }; + this.isSaveing = true; + this.$HTTP.post("/api/blade-system/custom-template-field-relation/insert",obj).then(res=> { + this.isSaveing = false; + if(res.code == 200) { + this.$emit('success', this.checkListData, this.mode); + this.visible = false; + this.$message.success("鎿嶄綔鎴愬姛"); + }else { + this.$alert(res.message, "鎻愮ず", {type: 'error'}); + } + }) + }, + //琛ㄥ崟娉ㄥ叆鏁版嵁 + setData(data){ + //Object.assign(this.addPlanForm, data); + } + } + } +</script> + +<style scoped> +.add-field { + color: #409eff; + font-weight: 400; + font-size: 14px; + cursor: pointer; + padding-left: 8px; + margin: 0; +} +.field-title { + font-size: 14px; + color: #5f5f5f; + margin: 14px 0; +} +</style> diff --git a/src/views/notification/notice/newsmail.vue b/src/views/notification/notice/newsmail.vue new file mode 100644 index 0000000..167cbc8 --- /dev/null +++ b/src/views/notification/notice/newsmail.vue @@ -0,0 +1,78 @@ +<!-- + * @Author: lzhe lzhe@example.com + * @Date: 2024-03-26 10:28:33 + * @LastEditors: lzhe lzhe@example.com + * @LastEditTime: 2024-05-08 18:22:48 + * @FilePath: /smart-web/src/views/master/person/main/index.vue + * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE +--> +<template> + <div class="newsmail-main"> + <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick"> + <el-tab-pane label="鍏ㄩ儴鍏憡" name="A"> + <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef"> + <el-table-column prop="categoryName" label="title"></el-table-column> + <el-table-column prop="businessName" label="content"></el-table-column> + <el-table-column prop="notifyTime" label="date"></el-table-column> + <el-table-column fixed="right" label="鎿嶄綔"> + <template #default="scope"> + <el-button text type="primary" size="small" @click="table_view(scope.row, scope.$index)">鏌ョ湅鏇村>></el-button> + </template> + </el-table-column> + </el-table> + </el-tab-pane> + <el-tab-pane label="鍙戝竷鍏憡" name="B">Config</el-tab-pane> + <el-tab-pane label="浠诲厤鍏憡" name="C">Role</el-tab-pane> + <el-tab-pane label="杞彂鍏憡" name="D">Task</el-tab-pane> + <el-tab-pane label="鎸囩ず鍏憡" name="E">Task</el-tab-pane> + <el-tab-pane label="浜嬪姟鍏憡" name="F">Task</el-tab-pane> + </el-tabs> + </div> +</template> +<script> + export default { + name: "newmail", + data(){ + return { + tableData: [], + activeName: "A" + } + }, + created(){ + + }, + mounted(){ + this.getcategoryList(); + }, + components: { + + }, + methods: { + table_view() { + + }, + handleClick(TabPaneName) { + + }, + getcategoryList() { + this.$HTTP.get(`/api/blade-notify/notify-system/page?size=10¬ifyType=2¤t=1`).then(res=> { + if(res.code == 200) { + this.tableData = res.data.records; + } + }) + } + } + } +</script> + +<style scoped> +.newsmail-main { + min-height: 100%; + margin: 8px; + padding:20px; + background: #fff; +} +.multipleTableRef /deep/ .el-table__header-wrapper{ + display: none; +} +</style> -- Gitblit v1.9.3