| | |
| | | <template> |
| | | <basic-container> |
| | | <div class="norightmenu" v-if="!isSearch"> |
| | | <avue-crud :addBtn="false" :option="option" :table-loading="loading" :data="treeData" ref="crud" |
| | | <avue-crud :addBtn="false" :option="option" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" :table-loading="loading" :data="treeData" ref="crud" |
| | | v-model:search="search" v-model:page="mypage" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad" @row-click="rowClick"> |
| | | <template #search> |
| | |
| | | <el-checkbox value="3" label="偏离" /> |
| | | </el-checkbox-group> |
| | | </el-col> |
| | | <el-col :span="4" class="search-data-flex"> |
| | | <el-col :span="6" class="search-data-flex"> |
| | | <span class="search-data-title">零组件号:</span> |
| | | <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="零组件号" |
| | | <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="输入至少3个字符过滤数据" |
| | | :remote-method="remoteMethod" :loading="searchLoading"> |
| | | <el-option v-for="item in drawingNoList" :key="item.value" :label="item.label" |
| | | :value="item.value" /></el-select> |
| | |
| | | end-placeholder="结束时间" :size="size" format="YYYY-MM-DD" value-format="YYYY-MM-DD" |
| | | @change="createTimeChange" /><!--:disabled-date="disabledDate" 不需要禁用日期--> |
| | | </el-col> |
| | | <el-col :span="6" class="search-data-flex"> |
| | | <el-col :span="4" class="search-data-flex"> |
| | | <el-button type="primary" @click="searchTree" :loading="treeSearchLoad"><el-icon class="el-icon--right" |
| | | style="margin-right: 6px;"> |
| | | <Search /> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | <!-- <template #menu-left> |
| | | <el-button :size="size" type="primary" @click="showAdd()">新增根节点</el-button> |
| | | </template> --> |
| | | |
| | | <template #name="{ row }"> |
| | | <span>{{ row.name }}</span> |
| | | <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="修改" @click="showEdit(row)" title="修改"></el-button> |
| | | <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="删除" title="删除"></el-button> |
| | | <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="新增子级" title="新增子级"></el-button> |
| | | <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="文件上传" title="文件上传"></el-button> --> |
| | | <!-- 涉密网才有 --> |
| | | <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="升版" title="升版"></el-button> --> |
| | | <!-- 工控网才有 --> |
| | | <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="下发" title="下发"></el-button> --> |
| | | |
| | | |
| | | <!-- 替换 v-if="permission.auto_dispatch"--> |
| | | <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1" |
| | | icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="替换" title="替换"></el-button> |
| | | <el-button :size="size" text |
| | | v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1" |
| | | icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="锁定" title="锁定"></el-button> |
| | | icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="锁定" title="锁定"></el-button> |
| | | <el-button :size="size" text |
| | | v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1" |
| | | icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="解锁" title="解锁"></el-button> |
| | | icon="el-icon-unlock" type="primary" @click="showUnLockDlg(row)" placeholder="解锁" title="解锁"></el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <div class="norightmenu" v-else> |
| | | <avue-crud :addBtn="false" :option="option" :table-loading="loading" :data="treeData" ref="crud" |
| | | <avue-crud :addBtn="false" :option="option" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" :table-loading="loading" :data="treeData" ref="crud" |
| | | v-model:search="search" v-model:page="mypage" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad" @row-click="rowClick"> |
| | | <template #search> |
| | |
| | | </el-col> |
| | | <el-col :span="4" class="search-data-flex"> |
| | | <span class="search-data-title">零组件号:</span> |
| | | <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="零组件号" |
| | | <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="输入至少3个字符过滤数据" |
| | | :remote-method="remoteMethod" :loading="searchLoading"> |
| | | <el-option v-for="item in drawingNoList" :key="item.value" :label="item.label" |
| | | :value="item.value" /></el-select> |
| | |
| | | </template> --> |
| | | <template #name="{ row }"> |
| | | <span>{{ row.name }}</span> |
| | | <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="修改" @click="showEdit(row)" title="修改"></el-button> |
| | | <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="删除" title="删除"></el-button> |
| | | <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="新增子级" title="新增子级"></el-button> |
| | | <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="文件上传" title="文件上传"></el-button> --> |
| | | <!-- 涉密网才有 --> |
| | | <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="升版" title="升版"></el-button> --> |
| | | <!-- 工控网才有 --> |
| | | <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="下发" title="下发"></el-button> --> |
| | | |
| | | |
| | | <!-- 替换 v-if="permission.auto_dispatch"--> |
| | | <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1" |
| | | icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="替换" title="替换"></el-button> |
| | | <el-button :size="size" text |
| | | v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1" |
| | | icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="锁定" title="锁定"></el-button> |
| | | icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="锁定" title="锁定"></el-button> |
| | | <el-button :size="size" text |
| | | v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1" |
| | | icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="解锁" title="解锁"></el-button> |
| | | icon="el-icon-unlock" type="primary" @click="showUnLockDlg(row)" placeholder="解锁" title="解锁"></el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | |
| | | <div v-else>没有上传文件</div> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | <!-- 锁定对话框 --> |
| | | <el-dialog title="程序锁定" append-to-body v-model="lockBox"> |
| | | <avue-form :option="lockOption" v-model="lockForm" @submit="lockSubmit" @reset-change="lockCancel" /> |
| | | </el-dialog> |
| | | <el-dialog title="程序解锁" append-to-body v-model="unlockBox"> |
| | | <avue-form :option="unlockOption" v-model="unlockForm" @submit="unlockSubmit" @reset-change="unlockCancel" /> |
| | | </el-dialog> |
| | | <avue-tabs :option="tabsOption" @change="tabsHandleChange" style="margin-top: 30px;" v-if="isShowTabs"></avue-tabs> |
| | | <avue-form v-if="tabsType == 'tab1'" :option="tabsFormOption" v-model="tabsForm"></avue-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import debounce from 'lodash/debounce'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import TodolistLeft from './components/TodolistLeft.vue'; |
| | | import TodolistRightTop from './components/TodolistRightTop.vue'; |
| | | import qs from 'qs'; |
| | | export default { |
| | | components: { |
| | | TodolistLeft, |
| | |
| | | data() { |
| | | let rejectText = '驳回';//+this.row.categoryName; |
| | | return { |
| | | isSearch: false, |
| | | isSearch: null, |
| | | treeSearchLoad: false, |
| | | drawingNoList: [], |
| | | searchLoading: false, |
| | |
| | | icon: 'el-icon-info', |
| | | label: '节点信息', |
| | | prop: 'tab1', |
| | | }/*, { |
| | | icon: 'el-icon-warning', |
| | | label: '版本信息', |
| | | prop: 'tab2', |
| | | }*/] |
| | | } |
| | | ] |
| | | }, |
| | | tabsOption2: { |
| | | column: [{ |
| | | icon: 'el-icon-info', |
| | | label: '节点信息', |
| | | prop: 'tab1', |
| | | },/* { |
| | | icon: 'el-icon-warning', |
| | | label: '版本信息', |
| | | prop: 'tab2', |
| | | }, */{ |
| | | }, |
| | | { |
| | | icon: 'el-icon-warning', |
| | | label: '文件内容', |
| | | prop: 'tab3' |
| | |
| | | }, |
| | | modalBox: false, |
| | | modalTitle: "", |
| | | |
| | | lockOption: { |
| | | submitText: "锁定", |
| | | emptyText: "取消", |
| | | menuPosition: "right", |
| | | column: [ |
| | | { |
| | | label: '程序包名', |
| | | prop: 'name', |
| | | disabled:true, |
| | | labelWidth: "120", |
| | | }, |
| | | |
| | | { |
| | | label: '锁定原因', |
| | | prop: 'remark', |
| | | type: "textarea", |
| | | labelWidth: "120", |
| | | span: 24, |
| | | rules: [{ required: true, message: '必填', trigger: 'blur' }], |
| | | } |
| | | ] |
| | | }, |
| | | lockForm: {}, |
| | | lockBox: false, |
| | | |
| | | unlockOption: { |
| | | submitText: "启动解锁流程", |
| | | emptyText: "取消", |
| | | menuPosition: "right", |
| | | column: [ |
| | | { |
| | | label: '程序包名', |
| | | prop: 'name', |
| | | disabled:true, |
| | | labelWidth: "120", |
| | | }, |
| | | { |
| | | label: '锁定原因', |
| | | prop: 'remark', |
| | | type: "textarea", |
| | | disabled:true, |
| | | labelWidth: "120", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: '解锁原因', |
| | | prop: 'unlockReason', |
| | | type: "textarea", |
| | | labelWidth: "120", |
| | | span: 24, |
| | | } |
| | | ] |
| | | }, |
| | | unlockForm: {}, |
| | | unlockBox: false, |
| | | |
| | | id: "", |
| | | parentId: 1, |
| | | loading: true, |
| | |
| | | width: '360' |
| | | }, |
| | | { |
| | | label: '版本', |
| | | label: '程序版本', |
| | | prop: 'versionNumber', |
| | | formatter: (val, value, label) => { |
| | | if (val.nodeType == '60') { |
| | |
| | | return ''; |
| | | } |
| | | } |
| | | },/* |
| | | { |
| | | label: '版次', |
| | | prop: 'processEdition', |
| | | formatter: (val, value, label) => { |
| | | if(val.nodeType == '60'){ |
| | | return value; |
| | | }else{ |
| | | return ''; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop: 'abc' |
| | | },*/ |
| | | { |
| | | label: '类型', |
| | | prop: 'nodeTypeName' |
| | |
| | | label: '锁定状态', |
| | | prop: 'isLocked', |
| | | formatter: (val, value, label) => { |
| | | if (val.nodeType == '60' || val.nodeType == '70') { |
| | | if (val.nodeType == '60') { |
| | | if (value == 1) { |
| | | return '已锁定'; |
| | | } else { |
| | |
| | | } |
| | | } |
| | | }, |
| | | },/* |
| | | { |
| | | label: '测试程序', |
| | | prop: 'abc' |
| | | },*/ |
| | | }, |
| | | { |
| | | label: '创建人', |
| | | prop: 'createUserName', |
| | |
| | | this.searchTreeData.createTimeEnd = value[1]; |
| | | }, |
| | | remoteMethod(query) { |
| | | if (query) { |
| | | if (query && query.length>2) { |
| | | this.searchLoading = true; |
| | | axios({ |
| | | this.getRemote(query); |
| | | } else { |
| | | this.drawingNoList = []; |
| | | } |
| | | }, |
| | | getRemote: debounce(function(query){ |
| | | //防抖,这里设置600毫秒请求一次后台 |
| | | this.getList(query) |
| | | },600), |
| | | async getList(query){ |
| | | this.searchLoading = false; |
| | | axios({ |
| | | url: '/blade-mdm/program/node/drawing-no-pick', |
| | | method: 'get', |
| | | params: { drawingNo: query } |
| | |
| | | }) |
| | | this.drawingNoList = drawingNoList; |
| | | }); |
| | | } else { |
| | | this.drawingNoList = []; |
| | | } |
| | | }, |
| | | locked(row, isLockP) { |
| | | //row.isLocked == isLock |
| | | var isLock = row.isLocked == 1; |
| | | console.log('isLock', isLock) |
| | | this.$confirm(`是否${isLock ? '解锁' : '锁定'}`, { |
| | | showLockDlg(row){ |
| | | //this.lockForm = row; |
| | | this.lockForm.id = row.id; |
| | | this.lockForm.name = row.name |
| | | this.lockForm.parentId = row.parentId; |
| | | this.lockForm.remark = ''; |
| | | this.lockBox = true; |
| | | }, |
| | | lockCancel() { |
| | | this.lockBox = false; |
| | | this.lockForm = {}; |
| | | }, |
| | | showUnLockDlg(row){ |
| | | this.unlockForm.id = row.id; |
| | | this.unlockForm.name = row.name |
| | | this.unlockForm.remark = row.remark; |
| | | this.unlockForm.unlockReason=''; |
| | | this.unlockForm.parentId = row.parentId; |
| | | this.unlockBox = true; |
| | | }, |
| | | lockSubmit(row,done) { |
| | | //console.log(row,done) |
| | | //锁定提交 |
| | | this.$confirm('是否锁定', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | axios.post('/blade-mdm/program/node/lock',qs.stringify(this.lockForm)).then(res=>{ |
| | | console.log('res',res.data) |
| | | if (res.data.code == 200) { |
| | | this.$message({ type: 'success', message: '操作成功!' }); |
| | | this.addLocalTreeNode(this.lockForm.parentId); |
| | | this.unlockBox = false; |
| | | } else { |
| | | this.$message({ type: 'error', message: res.data.msg }); |
| | | } |
| | | this.lockBox = false; |
| | | }).catch(error => { |
| | | this.$message({ type: 'error', message: res.data.msg }); |
| | | }); |
| | | done(); |
| | | }).catch(action => { |
| | | console.log('cancel') |
| | | }); |
| | | }, |
| | | unlockSubmit(row,done) { |
| | | //启动解锁流程 |
| | | this.$confirm(`确认解锁`, { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | axios({ |
| | | url: isLock ? '/blade-mdm/flow/lock/start-unlock' : '/blade-mdm/program/node/lock', |
| | | url: '/blade-mdm/flow/lock/start-unlock', |
| | | method: 'post', |
| | | params: { id: row.id, nodeId: row.id } |
| | | params: {nodeId: row.id,unlockReason:row.unlockReason } |
| | | }).then(res => { |
| | | if (res.data.code == 200) { |
| | | this.$message({ type: 'success', message: '操作成功!' }); |
| | | this.$message({ type: 'success', message: '解锁流程已启动!' }); |
| | | this.addLocalTreeNode(row.parentId); |
| | | } else { |
| | | this.$message({ type: 'success', message: res.data.msg }); |
| | | this.$message({ type: 'error', message: res.data.msg }); |
| | | } |
| | | }); |
| | | done(); |
| | | }).catch(action => { |
| | | console.log('cancel') |
| | | }); |
| | | }, |
| | | unlockCancel() { |
| | | this.unlockBox = false; |
| | | }, |
| | | handleSubmit(form, done) { |
| | | //发起程序替换流程 |
| | |
| | | window.console.log('haha', error); |
| | | done(); |
| | | }); |
| | | // if(this.row.taskDefinitionKey === 'programmingTask') { |
| | | // // if(this.applist.length !== 1) { |
| | | // // done(); |
| | | // // return this.$message.success('请选择1个程序'); |
| | | // // } |
| | | // } |
| | | // approve({ |
| | | // ...this.formApprove, |
| | | // taskId: this.row.taskId, |
| | | // processInstanceId: this.row.processInstanceId, |
| | | // // programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '', |
| | | // }).then(res => { |
| | | // if(res.data.code !== 200) { |
| | | // this.$message.error(res.data.msg); |
| | | // done(); |
| | | // return; |
| | | // } |
| | | // this.$message.success('审批成功'); |
| | | // this.approveBox = false; |
| | | // this.onLoad(this.page, this.query); |
| | | // done(); |
| | | // }).catch(err => { |
| | | // done(); |
| | | // console.error(err); |
| | | // }); |
| | | |
| | | }, |
| | | todoSelectionChange(applist) { |
| | | this.applist = applist; |
| | | }, |
| | | showReplaceDlg(row) { //替换对话框 |
| | | |
| | | if (row.nodeType == 60) { //程序包 |
| | | return; |
| | | } |
| | | //111 |
| | | this.modalTitle = "新增子节点"; |
| | | this.selectedColumn.parentId = row.id; |
| | | this.modalForm = this.selectedColumn; |
| | | |
| | | this.modalBox = true; |
| | | }, |
| | | replacement(row) { //替换 |
| | | this.id = row.id; |
| | |
| | | }); |
| | | }, |
| | | searchTree() { |
| | | if (this.searchTreeData.programStatus.length == 0) return; |
| | | if (this.searchTreeData.drawingNo == "") return; |
| | | if (this.searchTreeData.programStatus.length == 0 || this.searchTreeData.drawingNo == ""){ |
| | | this.$message.warning('请输入程序状态和零组件号进行搜索'); |
| | | return; |
| | | } |
| | | |
| | | this.treeSearchLoad = true; |
| | | this.isSearch = true |
| | | this.isSearch = !this.isSearch |
| | | this.searchTreeData.status = this.searchTreeData.programStatus.join(); |
| | | this.treeData = [] |
| | | this.defaultExpandedKeys = [] |
| | | axios({ |
| | | url: '/blade-mdm/program/node/search-list2', |
| | | method: 'get', |
| | | params: this.searchTreeData |
| | | }).then(res => { |
| | | this.treeSearchLoad = false; |
| | | if (res.data.data.length == 0) return; |
| | | |
| | | if (res.data.data.length == 0) { |
| | | this.treeData = []; |
| | | this.treeSearchLoad = false; |
| | | return |
| | | }; |
| | | // this.option.defaultExpandAll = true; |
| | | let treeData = this.removeHasChildren(res.data.data); |
| | | console.log('treeData', treeData) |
| | | this.option = Object.assign({},this.option,{defaultExpandedKeys: this.defaultExpandedKeys,lazy: true,defaultExpandAll: true}); |
| | | setTimeout(() => { |
| | | this.treeSearchLoad = false; |
| | | this.treeData = treeData; |
| | | this.$nextTick(() => { |
| | | this.highlightTargetRow(); // 设置当前行高亮 |
| | |
| | | this.modalBox = true; |
| | | this.modalForm = row; |
| | | }, |
| | | showDel(row) { |
| | | this.$confirm('将会删除该节点及其子节点,是否确认删除?', { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '否', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | //调用接口 |
| | | this.loading = true; |
| | | axios({ |
| | | url: '/blade-mdm/program/node/remove', |
| | | method: 'post', |
| | | params: { id: row.id }, |
| | | }).then( |
| | | res => { |
| | | this.loading = false; |
| | | this.addLocalTreeNode(row.parentId); |
| | | } |
| | | ); |
| | | }) |
| | | }, |
| | | showAdd(row) { //新增子节点 |
| | | if (!row) { |
| | | this.modalTitle = "新增根节点"; |
| | | this.modalForm.nodeType = this.nodeTypeList[0].dictKey; |
| | | this.modalForm.parentId = 0; |
| | | } else { |
| | | if (row.nodeType == 60) { //程序包 |
| | | return; |
| | | } |
| | | var defalutNodeType = ""; //下一级节点类型 |
| | | for (var i = 0; i < this.nodeTypeList.length; i++) { |
| | | if (row.nodeType == this.nodeTypeList[i].dictKey) { |
| | | defalutNodeType = this.nodeTypeList[i + 1].dictKey; |
| | | } |
| | | } |
| | | this.modalTitle = "新增子节点"; |
| | | this.selectedColumn.nodeType = defalutNodeType; |
| | | this.selectedColumn.parentId = row.id; |
| | | this.selectedColumn.name = ""; |
| | | this.selectedColumn.id = ""; |
| | | this.modalForm = this.selectedColumn; |
| | | } |
| | | this.modalBox = true; |
| | | }, |
| | | |
| | | modalSubmit(row, done) { //新增子节点保存/修改 |
| | | if (this.modalTitle == "修改") { |
| | | var url = "/blade-mdm/program/node/update"; |
| | |
| | | console.log('tree', tree, treeNode, this.option) |
| | | this.loading = true; |
| | | var obj = { parentId: tree.id } |
| | | |
| | | axios({ |
| | | url: '/blade-mdm/program/node/lazy-list', |
| | | method: 'get', |
| | |
| | | |
| | | }, |
| | | onLoad() { //查询treeTable |
| | | if(this.isSearch !== null){ |
| | | return |
| | | } |
| | | this.loading = true; |
| | | var obj = { parentId: "" } |
| | | |
| | | axios({ |
| | | url: '/blade-mdm/program/node/lazy-list', |
| | | method: 'get', |
| | |
| | | } |
| | | |
| | | .search-data-title { |
| | | font-size: 12px; |
| | | font-size: 14px; |
| | | margin-right: 8px; |
| | | display: inline-block; |
| | | width: 95px; |