1
lzhe
2024-05-08 b03d80f7743535f6a2fa830c7ab79f8fa3c3eeed
1
已添加2个文件
已修改4个文件
389 ■■■■■ 文件已修改
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/state-feedback.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/notification/business.vue 217 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/notification/notice/addNote.vue 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/notification/notice/index.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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",
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);
src/views/mdc/state-feedback.vue
@@ -247,7 +247,6 @@
                }
                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(()=> {
@@ -255,8 +254,6 @@
                                this.$refs.treeRef.setCurrentKey(this.lastLevelId);  //第一个节点的第一个子节点最后一级默认选中
                                this.getlist();  //渲染反馈列表
                            })
                        }
                    }
                })
            },
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>
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>
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) {