| | |
| | | * @Author: lzhe lzhe@example.com |
| | | * @Date: 2024-03-26 10:28:33 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-04-19 18:18:19 |
| | | * @LastEditTime: 2024-05-09 18:06:28 |
| | | * @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 |
| | | --> |
| | |
| | | <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" /> |
| | | <el-col :span="8" v-for="(item,index) in contentData"> |
| | | <el-checkbox v-model="item.checked" label="选择" size="large" /> |
| | | <div class="box-top"> |
| | | <div>{{item.notifyName}}</div> |
| | | <div>{{item.notifyTemplateName}}</div> |
| | | <div> |
| | | <span><el-icon><EditPen /></el-icon>编辑</span> |
| | | <div class="box-top-name">{{item.notifyName}}</div> |
| | | <div class="box-top-title">{{item.notifyTemplateName}}</div> |
| | | <div class="box-top-btn"> |
| | | <span @click="table_edit(item, index)"><el-icon><EditPen /></el-icon>编辑</span> |
| | | <span><el-icon><Delete /></el-icon>删除</span> |
| | | </div> |
| | | </div> |
| | |
| | | <span class="ct-span">默认对象</span> |
| | | </div> |
| | | <div class="template-content-box"> |
| | | <el-radio-group v-model="radio1"> |
| | | <el-radio-group v-model="radio1" @change="radio1Change"> |
| | | <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> |
| | | <el-button type="primary" plain @click="addOrganization" v-show="isaddOrganization">点击添加+</el-button> |
| | | <!-- 部门选择 --> |
| | | <span v-if="radio1 == 1" v-for="(item,index) in organizationLi" class="tagItem">{{item.name}}<el-icon @click="delOrganizationLi(index)" style="cursor: pointer;"><Close /></el-icon></span> |
| | | <el-select v-if="radio1 == 1" v-show="!isaddOrganization" v-model="organization" style="width: 20%" @change="organizationChange"> |
| | | <el-option v-for="item in organizationList" :key="item.parentId" :label="item.name" :value="item.parentId"/> |
| | | </el-select> |
| | | <!-- 员工选择 --> |
| | | <span v-if="radio1 == 2" v-for="(item,index) in employeeLi" class="tagItem">{{item.name}}<el-icon @click="delEmployeeLi(index)" style="cursor: pointer;"><Close /></el-icon></span> |
| | | <el-select v-if="radio1 == 2" v-show="!isaddOrganization" v-model="employee" style="width: 20%" @change="employeeChange"> |
| | | <el-option v-for="item in employeeList" :key="item.id" :label="item.organizationName + '-' + item.name" :value="item.id"/> |
| | | </el-select> |
| | | </div> |
| | | <div class="bottom-btn"> |
| | | <el-button @click="resetData">重置</el-button> |
| | | <el-button type="primary" :loading="isSaveing" @click="saveSubmit">保存</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> --> |
| | | <save-dialog v-if="dialog.save" ref="saveDialog" @success="addbusinessSuccess" @closed="dialog.save=false"></save-dialog> |
| | | </template> |
| | | <script> |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
| | |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | icons.push(key) |
| | | } |
| | | // import saveDialog from './add-feedback' |
| | | import saveDialog from './editbusiness' |
| | | export default { |
| | | name: "business", |
| | | data(){ |
| | | return { |
| | | isSaveing: false, |
| | | employeeLi: [], |
| | | organizationLi: [], |
| | | isaddOrganization: true, |
| | | organizationList: [], |
| | | employeeList: [], |
| | | organization: "", |
| | | employee: "", |
| | | radio1: 1, |
| | | checked1: true, |
| | | tableData: [], |
| | |
| | | mounted(){ |
| | | this.getTreeList(); |
| | | this.getbusiness(); |
| | | this.getgroupType(); |
| | | this.getEmployeeList(); |
| | | }, |
| | | components: { |
| | | ...ElementPlusIconsVue |
| | | //saveDialog |
| | | ...ElementPlusIconsVue,saveDialog |
| | | }, |
| | | methods: { |
| | | saveSubmit() { |
| | | |
| | | }, |
| | | resetData() { |
| | | this.employeeLi = []; |
| | | this.organizationLi = []; |
| | | }, |
| | | radio1Change(val) { |
| | | this.getgroupType(val); |
| | | }, |
| | | addOrganization() { |
| | | this.isaddOrganization = false; |
| | | }, |
| | | organizationChange(val) { |
| | | var flag = this.organizationLi.some(function(item) { |
| | | return item.parentId === val; |
| | | }); |
| | | this.organizationList.forEach(item=> { |
| | | if(item.parentId == val && !flag) { |
| | | this.organizationLi.push(item); |
| | | } |
| | | }) |
| | | }, |
| | | employeeChange(val) { |
| | | var flag = this.employeeLi.some(function(item) { |
| | | return item.id === val; |
| | | }); |
| | | this.employeeList.forEach(item=> { |
| | | if(item.id == val && !flag) { |
| | | this.employeeLi.push(item); |
| | | } |
| | | }) |
| | | }, |
| | | delOrganizationLi(index) { |
| | | this.organizationLi.splice(index,1); |
| | | }, |
| | | delEmployeeLi(index) { |
| | | this.employeeLi.splice(index,1); |
| | | }, |
| | | getgroupType() { |
| | | this.$HTTP.get("/api/blade-cps/organization/list?groupType=group_organization&groupCategory=1").then(res=> { |
| | | if(res.code == 200) { |
| | | this.organizationList = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | getEmployeeList() { |
| | | this.$HTTP.get("/api/blade-cps/employee/get/list?organizationCode=00001&status=1").then(res=> { |
| | | if(res.code == 200) { |
| | | this.employeeList = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | table_edit(row){ |
| | | if(row.notifyName == "钉钉") { |
| | | var url = `/api/blade-notify/notifier/template/dingTalk/dingTalkMessage/config/metadata`; |
| | | }else if(row.notifyName == "企业微信") { |
| | | var url = `/api/blade-notify/notifier/template/weiXinQY/qyTextMessage/config/metadata`; |
| | | }else if(row.notifyName == "站内信") { |
| | | var url = `/api/blade-notify/notifier/template/internalMessage/systemDefault/config/metadata`; |
| | | }else if(row.notifyName == "邮件") { |
| | | var url = `/api/blade-notify/notifier/template/email/embedded/config/metadata`; |
| | | } |
| | | this.dialog.save = true |
| | | this.$HTTP.get(url).then(res=> { |
| | | if(res.code == 200) { |
| | | this.dialog.save = true; |
| | | this.$nextTick(() => { |
| | | var obj = Object.assign(row,res.data); |
| | | this.$refs.saveDialog.open('edit').setData(obj); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | getbusiness() { |
| | | this.$HTTP.get("/api/blade-notify/business-notify?businessKey=maintenance").then(res=> { |
| | | if(res.code == 200) { |
| | | res.data.businessNotifyDTOList.forEach(item=> { |
| | | item.checked = (item.status == '0'?false: true); |
| | | }) |
| | | this.contentData = res.data.businessNotifyDTOList; |
| | | } |
| | | }) |
| | |
| | | this.$HTTP.get("/api/blade-notify/business-notify/tree").then(res=> { |
| | | if(res.code == 200) { |
| | | this.tableData = res.data; |
| | | console.log(this.tableData,123) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | |
| | | // }) |
| | | // }, |
| | | addfeedbackSuccess() { |
| | | //this.getlist(); |
| | | addbusinessSuccess() { |
| | | this.getbusiness(); |
| | | } |
| | | } |
| | | } |
| | |
| | | background: #fff; |
| | | margin-right: 20px; |
| | | box-shadow: 0 1px 3px rgba(0,0,0,.16); |
| | | position: relative; |
| | | } |
| | | .content { |
| | | padding: 10px; |
| | |
| | | height: 200px; |
| | | overflow: auto; |
| | | } |
| | | .box-top-name { |
| | | font-weight: 700; |
| | | font-size: 18px; |
| | | text-align: left; |
| | | color: #333; |
| | | display: block; |
| | | margin-top: -30px; |
| | | margin-left: 56px; |
| | | } |
| | | .box-top-title { |
| | | font-size: 14px; |
| | | text-align: left; |
| | | color: #333; |
| | | display: block; |
| | | margin-top: -30px; |
| | | margin-left: 56px; |
| | | padding: 0 20px 0 33px; |
| | | margin: 20px 0 10px 24px; |
| | | } |
| | | .box-top-btn { |
| | | position: absolute; |
| | | font-size: 14px; |
| | | right: 12px; |
| | | bottom: 12px; |
| | | cursor: pointer; |
| | | } |
| | | .box-top-btn span:nth-child(1) { |
| | | margin-right: 12px; |
| | | } |
| | | .tagItem { |
| | | margin: 10px 10px 10px 0; |
| | | background-color: #3b8e8e; |
| | | color: #fff; |
| | | border-color: #3b8e8e; |
| | | display: inline-block; |
| | | font-size: 12px; |
| | | padding: 4px 10px; |
| | | border-radius: 4px; |
| | | } |
| | | .bottom-btn { |
| | | margin-top: 20px; |
| | | text-align: center; |
| | | } |
| | | </style> |