From b03d80f7743535f6a2fa830c7ab79f8fa3c3eeed Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期三, 08 五月 2024 23:53:59 +0800
Subject: [PATCH] 1
---
src/views/mdc/state-feedback.vue | 17 +-
src/views/notification/notice/index.vue | 33 +++-
src/main.js | 2
package.json | 1
src/views/notification/notice/addNote.vue | 133 +++++++++++++++++++
src/views/notification/business.vue | 217 +++++++++++++++++++++++++++++++
6 files changed, 385 insertions(+), 18 deletions(-)
diff --git a/package.json b/package.json
index 761103b..bfbc46d 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,7 @@
"@element-plus/icons-vue": "2.0.10",
"@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
"@tinymce/tinymce-vue": "5.0.0",
+ "avue-plugin-ueditor": "^1.0.3",
"axios": "1.3.4",
"codemirror": "5.65.5",
"core-js": "3.29.0",
diff --git a/src/main.js b/src/main.js
index f01e76b..9464ca5 100644
--- a/src/main.js
+++ b/src/main.js
@@ -14,9 +14,11 @@
import store from './store'
import App from './App.vue'
import { setupCalendar } from 'v-calendar';
+import AvueUeditor from 'avue-plugin-ueditor'
const app = createApp(App);
+app.use(AvueUeditor);
app.use(setupCalendar, {})
app.use(store);
app.use(router);
diff --git a/src/views/mdc/state-feedback.vue b/src/views/mdc/state-feedback.vue
index 5816b01..885d190 100644
--- a/src/views/mdc/state-feedback.vue
+++ b/src/views/mdc/state-feedback.vue
@@ -247,16 +247,13 @@
}
this.$HTTP.post("/api/blade-cps/group/groupWorkstation/type",obj).then(res=> {
if(res.code == 200) {
- if (res.code == 200) {
- var treeDisabled = this.addTreeDisable(res.data);
- this.tableData = this.buildTree(treeDisabled); //浠庢墎骞冲寲鍙樹负鏍戠姸缁撴瀯
- this.$nextTick(()=> {
- this.lastLevelId = this.getLastLevelIds(this.tableData).lastLevelId;
- this.$refs.treeRef.setCurrentKey(this.lastLevelId); //绗竴涓妭鐐圭殑绗竴涓瓙鑺傜偣鏈�鍚庝竴绾ч粯璁ら�変腑
- this.getlist(); //娓叉煋鍙嶉鍒楄〃
- })
-
- }
+ var treeDisabled = this.addTreeDisable(res.data);
+ this.tableData = this.buildTree(treeDisabled); //浠庢墎骞冲寲鍙樹负鏍戠姸缁撴瀯
+ this.$nextTick(()=> {
+ this.lastLevelId = this.getLastLevelIds(this.tableData).lastLevelId;
+ this.$refs.treeRef.setCurrentKey(this.lastLevelId); //绗竴涓妭鐐圭殑绗竴涓瓙鑺傜偣鏈�鍚庝竴绾ч粯璁ら�変腑
+ this.getlist(); //娓叉煋鍙嶉鍒楄〃
+ })
}
})
},
diff --git a/src/views/notification/business.vue b/src/views/notification/business.vue
new file mode 100644
index 0000000..532e799
--- /dev/null
+++ b/src/views/notification/business.vue
@@ -0,0 +1,217 @@
+<!--
+ * @Author: lzhe lzhe@example.com
+ * @Date: 2024-03-26 10:28:33
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-04-19 18:18:19
+ * @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="aposcope-main">
+ <div class="aposcope-left">
+ <div class="left-title">涓氬姟鍒楄〃</div>
+ <el-tree :data="tableData" node-key="id" default-expand-all :expand-on-click-node="false" :props="defalutProps" @node-click="handleNodeClick" ref="treeRef" highlight-current>
+ <template #default="{ node, data }">
+ <span>{{ node.label }}( {{ data.startCount }} )</span>
+ </template>
+ </el-tree>
+ </div>
+ <div class="aposcope-right">
+ <div class="right-top">
+ 涓氬姟鎻忚堪锛�-
+ </div>
+ <div class="right-content">
+ <div class="content-title">
+ <span class="ct-span">閫氱煡鏂瑰紡</span>
+ <el-icon><Setting /></el-icon>
+ </div>
+ <el-row class="template-content-box">
+ <el-col :span="8" v-for="item in contentData">
+ <el-checkbox v-model="checked1" label="閫夋嫨" size="large" />
+ <div class="box-top">
+ <div>{{item.notifyName}}</div>
+ <div>{{item.notifyTemplateName}}</div>
+ <div>
+ <span><el-icon><EditPen /></el-icon>缂栬緫</span>
+ <span><el-icon><Delete /></el-icon>鍒犻櫎</span>
+ </div>
+ </div>
+ </el-col>
+ </el-row>
+ <div class="content-title">
+ <span class="ct-span">榛樿瀵硅薄</span>
+ </div>
+ <div class="template-content-box">
+ <el-radio-group v-model="radio1">
+ <el-radio :label="1">閮ㄩ棬</el-radio>
+ <el-radio :label="2">鍛樺伐</el-radio>
+ </el-radio-group>
+ <div class="content">
+ <el-button type="primary" plain>鐐瑰嚮娣诲姞+</el-button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+<!-- <save-dialog v-if="dialog.save" ref="saveDialog" :feedBackStatusList="feedBackStatusList" :workstationId="lastLevelId" @success="addfeedbackSuccess" @closed="dialog.save=false"></save-dialog> -->
+</template>
+<script>
+ import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+ let icons = []
+ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+ icons.push(key)
+ }
+ // import saveDialog from './add-feedback'
+ export default {
+ name: "business",
+ data(){
+ return {
+ radio1: 1,
+ checked1: true,
+ tableData: [],
+ contentData: [],
+ dialog: {
+ save: false
+ },
+ defalutProps: {
+ label: 'label',
+ children: 'children',
+ isLeaf: 'hasChildren',
+ disabled: 'disabled'
+ },
+ lastLevelId: "",
+ current: "1",
+ size: "15",
+ }
+ },
+ created(){
+
+ },
+ mounted(){
+ this.getTreeList();
+ this.getbusiness();
+ },
+ components: {
+ ...ElementPlusIconsVue
+ //saveDialog
+ },
+ methods: {
+ getbusiness() {
+ this.$HTTP.get("/api/blade-notify/business-notify?businessKey=maintenance").then(res=> {
+ if(res.code == 200) {
+ this.contentData = res.data.businessNotifyDTOList;
+ }
+ })
+ },
+ handleNodeClick(data) {
+ if(data.code) {
+ this.lastLevelId = data.id;
+ // this.$HTTP.post("/api/blade-cps/workstation-wcs-feedback/page?current=1&size=15",obj).then(res=> {
+ // if(res.code == 200) {
+ // this.searchDataList = res.data.records;
+ // }
+ // })
+ }
+ },
+ getTreeList() {
+ this.$HTTP.get("/api/blade-notify/business-notify/tree").then(res=> {
+ if(res.code == 200) {
+ this.tableData = res.data;
+ console.log(this.tableData,123)
+ }
+ })
+ },
+ // table_del(row) {
+ // this.$confirm(`纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?`, '', {
+ // type: 'warning'
+ // }).then(() => {
+ // var arr = [row.id]
+ // this.$HTTP.delete("/api/blade-cps/workstation-wcs-feedback",arr).then(res=> {
+ // if(res.code == 200) {
+ // this.$message.success("鎿嶄綔鎴愬姛");
+ // this.getlist();
+ // }
+ // })
+ // }).catch(() => {
+
+ // })
+ // },
+ addfeedbackSuccess() {
+ //this.getlist();
+ }
+ }
+ }
+</script>
+<style scoped>
+.aposcope-main {
+ display: flex;
+ min-height: 100%;
+ margin: 8px;
+}
+.aposcope-left {
+ width: 240px;
+ margin-right: 8px;
+ padding: 4px;
+ background-color: #fff;
+}
+.aposcope-right {
+ flex: 1;
+ padding: 8px;
+ background-color: #fff;
+}
+.left-title {
+ font-size: 16px;
+ text-align: center;
+ height: 38px;
+ line-height: 38px;
+ border-bottom: 1px solid #e2e2e2;
+ background-color: #409eff;
+ color: #fff;
+ border-radius: 2px 2px 0 0;
+}
+.right-content {
+ text-align: centefter;
+}
+.right-top {
+ width: 100%;
+ padding: 8px 16px;
+ background-color: #409eff;
+ color: #fff;
+ font-size: 13px;
+ line-height: 18px;
+}
+.content-title {
+ display: flex;
+ justify-content: space-between;
+ margin: 24px 0 0 0;
+ padding: 0 20px 0 10px;
+ border-left: 6px solid #3b8e8e;
+}
+.ct-span {
+ color: #101010;
+ font-size: 13px;
+ font-weight: 700;
+}
+.content-title i {
+ font-size: 20px;
+ color: #409eff;
+ cursor: pointer;
+}
+.template-content-box {
+ padding: 12px 0px 24px 20px;
+}
+.box-top {
+ height: 117px;
+ border-radius: 2px;
+ background: #fff;
+ margin-right: 20px;
+ box-shadow: 0 1px 3px rgba(0,0,0,.16);
+}
+.content {
+ padding: 10px;
+ border: 1px solid #409eff;
+ width: 500px;
+ height: 200px;
+ overflow: auto;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/notification/notice/addNote.vue b/src/views/notification/notice/addNote.vue
new file mode 100644
index 0000000..555fe48
--- /dev/null
+++ b/src/views/notification/notice/addNote.vue
@@ -0,0 +1,133 @@
+<template>
+ <el-dialog :title="titleMap[mode]" v-model="visible" :width="1000" destroy-on-close @closed="$emit('closed')">
+ <el-form :model="addNoteForm" :rules="addNoteRules" :disabled="mode=='show'" ref="dialogForm" label-width="120px" label-position="center">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label=" 鍏憡鏍囬" prop="title">
+ <el-input v-model="addNoteForm.title" placeholder="瀛楀吀缂栧彿" clearable></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍏憡绫诲瀷" prop="category">
+ <el-select v-model="addNoteForm.category" style="width: 100%" @change="searchChange">
+ <el-option v-for="item in categoryList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍏憡鍐呭" prop="content">
+ <avue-ueditor v-model="addNoteForm.content" v-bind="options"></avue-ueditor>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <template #footer>
+ <el-button @click="visible=false" >鍙� 娑�</el-button>
+ <el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="noteSubmit">淇� 瀛�</el-button>
+ </template>
+ </el-dialog>
+</template>
+
+<script>
+ export default {
+ emits: ['success', 'closed'],
+ data() {
+ return {
+ options: {
+ //鏅�氫笂浼犲湴鍧�
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ customConfig: {},//wangEditor缂栬緫鐨勯厤缃�
+ headers:{Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0"},
+ data:{},
+ propsHttp: {
+ home:'',
+ url:'url',
+ res: 'data'
+ },
+ },
+ categoryList: [],
+ value1: true,
+ mode: "add",
+ titleMap: {
+ add: '鏂板缓',
+ edit: '淇敼',
+ show: '鏌ョ湅'
+ },
+ visible: false,
+ isSaveing: false,
+ //琛ㄥ崟鏁版嵁
+ addNoteForm: {
+ title: "",
+ },
+ //楠岃瘉瑙勫垯
+ addNoteRules: {
+ title:[{required: true, message: '璇疯緭鍏ュ叕鍛婃爣棰�'}],
+ category:[{required: true, message: '璇烽�夋嫨鍏憡绫诲瀷',trigger: 'change'}],
+ sort:[{required: true, message: '璇疯緭鍏ュ瓧鍏告帓搴�'}]
+ },
+ //鎵�闇�鏁版嵁閫夐」
+ groups: [],
+ groupsProps: {
+ value: "id",
+ multiple: true,
+ checkStrictly: true
+ },
+ depts: [],
+ deptsProps: {
+ value: "id",
+ checkStrictly: true
+ }
+ }
+ },
+ mounted() {
+ },
+ methods: {
+ //鏄剧ず
+ open(mode='add',categoryList){
+ this.mode = mode;
+ this.visible = true;
+ this.categoryList = categoryList;
+ return this
+ },
+ //琛ㄥ崟鎻愪氦鏂规硶
+ noteSubmit(){
+ var obj = Object.assign({},this.addNoteForm);
+ this.$refs.dialogForm.validate(async (valid) => {
+ if (valid) {
+ this.isSaveing = true;
+ if(this.mode == "edit") {
+ var url = "/api/blade-notify/notice/update";
+ }else {
+ var url = "/api/blade-notify/notice/save";
+ }
+ this.$HTTP.post(url,obj).then(res=> {
+ this.isSaveing = false;
+ if(res.code == 200) {
+ this.$emit('success', this.addNoteForm, this.mode);
+ this.visible = false;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ }else {
+ this.$alert(res.message, "鎻愮ず", {type: 'error'});
+ }
+ })
+ }else{
+ return false;
+ }
+ })
+ },
+ //琛ㄥ崟娉ㄥ叆鏁版嵁
+ setData(data){
+ //鍙互鍜屼笂闈竴鏍峰崟涓敞鍏ワ紝涔熷彲浠ュ儚涓嬮潰涓�鏍风洿鎺ュ悎骞惰繘鍘�
+ this.$HTTP.get(`/api/blade-notify/notice/detail?id=${data.id}`).then(res=> {
+ if(res.code == 200) {
+ res.data.category = String(res.data.category);
+ Object.assign(this.addNoteForm, res.data);
+ }
+ })
+ }
+ }
+ }
+</script>
+
+<style>
+</style>
diff --git a/src/views/notification/notice/index.vue b/src/views/notification/notice/index.vue
index f26a22b..f008313 100644
--- a/src/views/notification/notice/index.vue
+++ b/src/views/notification/notice/index.vue
@@ -43,8 +43,9 @@
<el-table-column prop="updateTime" label="鍏憡鏃堕棿"></el-table-column>
<el-table-column fixed="right" label="鎿嶄綔">
<template #default="scope">
- <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">鏌ョ湅</el-button>
+ <el-button type="text" size="small" @click="table_show(scope.row, scope.$index)">鏌ョ湅</el-button>
<el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
+ <el-button type="text" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -61,10 +62,10 @@
</div>
</div>
- <!-- <save-dialog v-if="dialog.save" ref="saveDialog" @success="addUserSuccess" @closed="dialog.save=false"></save-dialog> -->
+ <save-dialog v-if="dialog.save" ref="saveDialog" @success="addUserSuccess" @closed="dialog.save=false"></save-dialog>
</template>
<script>
- // import saveDialog from './addUser'
+ import saveDialog from './addNote'
export default {
name: "bakalaka",
data(){
@@ -105,7 +106,7 @@
this.getcategoryList();
},
components: {
- //saveDialog
+ saveDialog
},
methods: {
searchChange() {
@@ -124,7 +125,7 @@
})
},
addUserSuccess() {
-
+ this.getData();
},
getData() {
var obj = {};
@@ -141,24 +142,40 @@
}
})
},
+ //鍒犻櫎
+ table_del(row) {
+ var that = this;
+ this.$confirm(`纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?`, '', {
+ type: 'warning'
+ }).then(() => {
+ this.$HTTP.post("/api/blade-notify/notice/remove?ids="+row.id).then(res=> {
+ if(res.code == 200) {
+ that.$message.success("鎿嶄綔鎴愬姛");
+ that.getData();
+ }
+ })
+ }).catch(() => {
+
+ })
+ },
//娣诲姞
addPerson(){
this.dialog.save = true
this.$nextTick(() => {
- this.$refs.saveDialog.open()
+ this.$refs.saveDialog.open('add',this.categoryList);
})
},
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
- this.$refs.saveDialog.open('edit').setData(row)
+ this.$refs.saveDialog.open('edit',this.categoryList).setData(row)
})
},
//鏌ョ湅
table_show(row){
this.dialog.save = true
this.$nextTick(() => {
- this.$refs.saveDialog.open('show').setData(row)
+ this.$refs.saveDialog.open('show',this.categoryList).setData(row)
})
},
handleSelectionChange(selection) {
--
Gitblit v1.9.3