From 3eced4f79a9cf7b211e86b26b8c8ca20ae3f4576 Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期一, 29 一月 2024 09:44:59 +0800
Subject: [PATCH] 获取集团分类根节点前端传null传入后端直接改为空字符串bug修复
---
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 1106 ++++++++++++++++++++++++++-------------------------------
1 files changed, 502 insertions(+), 604 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 3a5e81f..c11e7a3 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -4,83 +4,135 @@
<!-- 宸︿晶鑿滃崟-->
<el-aside>
<basic-container>
- <div>
- <div>
- <div style="display: flex; flex-direction: column;">
- <div style="display: flex;">
- <el-button plain size="small" type="primary" @click="TreeAdd" v-if="permissionList.TreeAddStatus">娣诲姞</el-button>
- <el-button plain size="small" type="primary" @click="TreeEdit" v-if="permissionList.TreeEditStatus">淇敼</el-button>
- <el-button plain size="small" type="primary" @click="TreeDel" v-if="permissionList.TreeDelStatus">鍒犻櫎</el-button>
- <el-button plain size="small" type="primary" @click="flushed" v-if="permissionList.flushedStatus">鍒锋柊</el-button>
- </div>
- <div style="display: flex; margin-top: 10px">
- <el-button plain size="small" type="primary" @click="Enable" v-if="permissionList.EnableStatus">鍚敤</el-button>
- <el-button plain size="small" type="primary" @click="Deactivate" v-if="permissionList.DeactivateStatus">鍋滅敤</el-button>
- <el-button plain size="small" type="primary" @click.native="ImportExcel" v-if="permissionList.ImportExcelStatus">瀵煎叆</el-button>
- <el-button plain size="small" type="primary" @click="ExportExcel" v-if="permissionList.ExportExcelStatus">瀵煎嚭</el-button>
- </div>
- </div>
- <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px">
- </div>
+ <div style="height: calc(100vh - 142px);!important;">
+ <div class="headerCon" style="display: flex; flex-wrap: wrap;margin-bottom: 5px">
+ <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">娣诲姞
+ </el-button>
+ <el-button v-if="permissionList.TreeEditStatus" v-show="allButtons" plain size="small" type="primary"
+ @click="TreeEdit">淇敼
+ </el-button>
+ <el-button v-if="permissionList.TreeDelStatus" v-show="allButtons" plain size="small" type="primary"
+ @click="TreeDel">鍒犻櫎
+ </el-button>
+ <el-button v-if="permissionList.flushedStatus" v-show="allButtons" plain size="small" type="primary"
+ @click="flushed">鍒锋柊
+ </el-button>
+ <el-button v-if="permissionList.EnableStatus" v-show="allButtons" plain size="small" type="primary"
+ @click="Enable">鍚敤
+ </el-button>
+ <el-button v-if="permissionList.DeactivateStatus" v-show="allButtons" plain size="small" type="primary"
+ @click="Deactivate">鍋滅敤
+ </el-button>
+ <el-button v-if="permissionList.ImportExcelStatus" v-show="allButtons" plain size="small" type="primary"
+ @click.native="ImportExcel">瀵煎叆
+ </el-button>
+ <el-button v-if="permissionList.ExportExcelStatus" v-show="allButtons" plain size="small" type="primary"
+ @click="ExportExcel">
+ 瀵煎嚭
+ </el-button>
+ <el-button v-if="permissionList.flowingBtnStuatus" v-show="allButtons" plain
+ size="small" style="width: 56px;text-align: center;padding-left: 3px" type="primary"
+ @click="flowingDependHandler">娴佹按澶勭悊
+ </el-button>
+ <el-button v-if="permissionList.classifyAuth" v-show="allButtons" plain size="small"
+ style="width: 56px;text-align: center;padding-left: 3px" type="primary"
+ @click="classifyAuthHandler">鍒嗙被鎺堟潈
+ </el-button>
+ <el-button v-if="permissionList.classifyAuth" v-show="allButtons" plain size="small"
+ style="width: 56px;text-align: center;padding-left: 3px" type="primary"
+ @click="dataAuthHandler">鏁版嵁鎺堟潈
+ </el-button>
</div>
-<!-- 宸︿晶鏍�-->
- <div style="height: calc(100vh - 230px);overflow: auto">
+ <!-- 宸︿晶鏍�-->
+ <div style="height: calc(100vh - 242px);overflow: auto">
<avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
:defaultExpandAll="false"
:option="Treeoption"
class="classifyTree"
@node-click="nodeClick"
>
+ <template slot-scope="{ node, data }" class="el-tree-node__label">
+ <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item"
+ effect="dark"
+ open-delay="500"
+ placement="right-start">
+ <span style="font-size: 14px;">
+ {{ (node || {}).label }}
+ </span>
+ </el-tooltip>
+ </template>
</avue-tree>
</div>
- <!-- 鏍戣妭鐐规坊鍔犲璇濇-->
- <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler"
- :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :visible.sync="TreeAddFormVisible" append-to-body
- style="width: 1700px;margin: auto">
- <el-form ref="myForm" :model="TreeAddform" :rules="rules">
- <el-form-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" prop="id"
- style="display: inline-block">
- <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
- </el-form-item>
- <el-form-item :label="this.TreeFlag ? '鍒嗙被鍚嶇О锛�' :'涓婚搴撳悕绉帮細'" label-width="110px" prop="name"
- style="display: inline-block">
- <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
- </el-form-item>
- <el-form-item v-if="TreeFlagCode" label="瀛樺偍鐨勪笟鍔$被鍨嬶細" label-width="150px" prop="btmTypeName">
- <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px"
- @focus="btmFoucus"></el-input>
- </el-form-item>
- <el-form-item label="鎻忚堪锛�" label-width="150px">
- <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input>
- </el-form-item>
- <el-form-item label="缂栫爜瑙勫垯锛�" label-width="150px">
- <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px"
- @focus="CodeFoucus"></el-input>
- </el-form-item>
- <el-form-item label="鍏抽敭灞炴�ф煡璇㈣鍒欙細" label-width="150px">
- <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px"
- @focus="Keyfouce"></el-input>
- </el-form-item>
- <el-form-item label="鐩镐技鏌ヨ瑙勫垯锛�" label-width="150px">
- <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px"
- @focus="simFouce"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="TreeEscHandler">鍙� 娑�</el-button>
- <el-button type="primary" @click="TreeAddHandler">纭� 瀹�</el-button>
- </div>
- </el-dialog>
- <!-- 淇敼瀵硅瘽妗�-->
- <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="淇敼鍒嗙被">
- <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode"
- :flag="'edit'"
- :loneTreeNewForm="TreeList" :nodeClickList="nodeClickList"
- :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed"
- @referTreeForm="referTreeForm"></classifyTreeform>
- </el-dialog>
</div>
+ <!-- 鏍戣妭鐐规坊鍔犲璇濇-->
+ <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler"
+ :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :visible.sync="TreeAddFormVisible" append-to-body
+ style="width: 1700px;margin: auto">
+ <el-form ref="myForm" :model="TreeAddform" :rules="rules">
+ <el-form-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" prop="id"
+ style="display: inline-block">
+ <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
+ </el-form-item>
+ <el-form-item :label="this.TreeFlag ? '鍒嗙被鍚嶇О锛�' :'涓婚搴撳悕绉帮細'" label-width="110px" prop="name"
+ style="display: inline-block">
+ <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
+ </el-form-item>
+ <el-form-item v-if="TreeFlagCode" label="瀛樺偍鐨勪笟鍔$被鍨嬶細" label-width="150px" prop="btmTypeName">
+ <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px"
+ @focus="btmFoucus"></el-input>
+ </el-form-item>
+ <el-form-item label="鎻忚堪锛�" label-width="150px">
+ <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input>
+ </el-form-item>
+ <el-form-item label="缂栫爜瑙勫垯锛�" label-width="150px">
+ <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px"
+ @focus="CodeFoucus"></el-input>
+ </el-form-item>
+ <el-form-item label="鍏抽敭灞炴�ф煡璇㈣鍒欙細" label-width="150px">
+ <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px"
+ @focus="Keyfouce"></el-input>
+ </el-form-item>
+ <el-form-item label="鏄惁鍙備笌鍏抽敭灞炴�ф牎楠岋細" label-width="170px">
+ <el-switch
+ v-model="TreeAddform.codeKeyAttrValue"
+ active-color="#13ce66"
+ active-text="鏄�"
+ inactive-color="#ff4949"
+ inactive-text="鍚�"
+ @change="switchChange">
+ </el-switch>
+ </el-form-item>
+ <el-form-item label="鐩镐技鏌ヨ瑙勫垯锛�" label-width="150px">
+ <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px"
+ @focus="simFouce"></el-input>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="TreeEscHandler">鍙� 娑�</el-button>
+ <el-button type="primary" @click="TreeAddHandler">纭� 瀹�</el-button>
+ </div>
+ </el-dialog>
+ <!-- 淇敼瀵硅瘽妗�-->
+ <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="淇敼鍒嗙被">
+ <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode"
+ :flag="'edit'"
+ :loneTreeNewForm="TreeEditObj" :nodeClickList="nodeClickList"
+ :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed"
+ @referTreeForm="referTreeForm"></classifyTreeform>
+ </el-dialog>
+ <!-- 鍒嗙被鎺堟潈瀵硅瘽妗�-->
+ <classify-auth-dialog
+ :TreeNode="TreeEditObj"
+ :classifyData="classifyData"
+ :visible.sync="classifyAuthVisible"
+ ></classify-auth-dialog>
+ <!-- 鏁版嵁鎺堟潈瀵硅瘽妗� -->
+ <data-auth-dialog
+ :TreeNode="TreeEditObj"
+ :classifyData="classifyData"
+ :visible.sync="dataAuthVisible"
+ ></data-auth-dialog>
</basic-container>
</el-aside>
<el-main>
@@ -88,7 +140,7 @@
<!-- 鍙充晶琛ㄦ牸-->
<avue-tabs :option="tabOption" @change="handleChange"></avue-tabs>
<span v-if="type.prop==='tab1'">
- <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeList"
+ <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeEditObj"
:nodeList="nodeList"></classifyTreeform>
</span>
<span v-else-if="type.prop==='tab2'">
@@ -106,9 +158,11 @@
</template>
<template slot="menuLeft">
- <el-button plain size="small" type="primary" @click="FindeHanler" v-if="permissionList.FindStatus">鏌ヨ</el-button>
- <el-button plain size="small" type="primary" @click="TemRefresh" v-if="permissionList.TemRefreshStatus">鍒锋柊</el-button>
- <el-button plain size="small" type="primary" @click="CloneBtn" v-if="permissionList.CloneBtnStuatus">浠庡叾瀹冩ā鏉垮厠闅�</el-button>
+ <el-button v-if="permissionList.FindStatus" plain size="small" type="primary"
+ @click="FindeHanler">鏌ヨ</el-button>
+ <el-button v-if="permissionList.TemRefreshStatus" plain size="small" type="primary"
+ @click="TemRefresh">鍒锋柊</el-button>
+ <el-button v-if="permissionList.CloneBtnStuatus" plain size="small" type="primary" @click="CloneBtn">浠庡叾瀹冩ā鏉垮厠闅�</el-button>
<!-- 鏌ヨ瀵硅瘽妗�-->
<el-dialog :visible.sync="FindFormVisible" append-to-body title="楂樼骇鏌ヨ">
<div>
@@ -232,147 +286,58 @@
</template>
</avue-crud>
</basic-container>
- <templatePro :Formlist="this.Formlist" :ProData="this.ProData" :codeClassifyOid="this.codeClassifyOid"
- :crudArray="this.crudArray" :crudLCStatus="this.crudLCStatus" :crudOid="this.crudOid"
- :rowIndex="this.selectRow"></templatePro>
+ <templatePro :Formlist="this.Formlist" :ProData="this.ProData" :btnAuthList="btnAuthList"
+ :codeClassifyOid="this.codeClassifyOid" :crudArray="this.crudArray"
+ :crudLCStatus="this.crudLCStatus"
+ :crudOid="this.crudOid" :rowIndex="this.selectRow"></templatePro>
</span>
<!-- 缂栫爜瑙勫垯-->
- <el-dialog :before-close="masterEscHandler" :visible.sync="MasterdialogVisible" append-to-body
- title="涓恒�愮紪鐮佽鍒欍�戦�夊彇鍊�">
- <template>
- <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
- <el-option
- v-for="item in SelectOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- style="width: 150px">
- </el-option>
- </el-select>
- <el-input v-model="SelectFInd" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" style="width: 260px;margin-left: 15px"></el-input>
- <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SelectFindeHandler">鏌ヨ
- </el-button>
- </template>
- <avue-crud :data="masterData" :option="Option" @row-click="masterSelect">
- <template slot="radio" slot-scope="{row}">
- <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
- </el-radio>
- </template>
- </avue-crud>
- <div style="height: 30px">
- <div
- style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px ">
- 宸茶缃殑鍊间负:[{{ this.TreeAddform.coderuleoidName == '' ? '鏈缃��' : this.TreeAddform.coderuleoidName }}]
- </div>
- <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
- <el-button size="small" type="primary" @click="MasterHandlerClick">纭畾</el-button>
- <el-button size="small" @click="masterEscHandler">鍙栨秷</el-button>
- </div>
- </div>
- </el-dialog>
+ <ThemeChildren
+ ref="ThemeMasterChildren"
+ :SelectOption="SelectOption"
+ :TreeAddform="TreeAddform"
+ :visible.sync="MasterdialogVisible"
+ code-lcstatus="Released"
+ codeName="codeRuleOidName"
+ codeType="coderule"
+ dialogTitle="缂栫爜瑙勫垯"
+ @defineHandler="handlerDefine"
+ ></ThemeChildren>
<!-- 鍏抽敭灞炴�ф煡璇㈣鍒�-->
- <el-dialog :before-close="KeyEscHandler" :visible.sync="KeydialogVisible" append-to-body title="涓恒�愬叧閿睘鎬ф煡璇㈣鍒欍�戦�夊彇鍊�">
- <template>
- <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
- <el-option
- v-for="item in SelectOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- style="width: 150px">
- </el-option>
- </el-select>
- <el-input v-model="SelectFInd" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" style="width: 260px;margin-left: 15px"></el-input>
- <el-button plain size="small" style="margin-left: 20px" type="primary" @click="KeySelectFindeHandler">鏌ヨ
- </el-button>
- </template>
- <avue-crud :data="KeyData" :option="Option" @row-click="KeySelect">
- <template slot="radio" slot-scope="{row}">
- <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
- </el-radio>
- </template>
- </avue-crud>
- <div style="height: 30px">
- <div
- style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px ">
- 宸茶缃殑鍊间负:[{{
- this.TreeAddform.codeKeyAttrRepeatOidName == '' ? '鏈缃��' : this.TreeAddform.codekeyattrrepeatoidName
- }}]
- </div>
- <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
- <el-button size="small" type="primary" @click="KeyHandlerClick">纭畾</el-button>
- <el-button size="small" @click="KeyEscHandler">鍙栨秷</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 鐩镐技椤规煡璇㈣鍒�-->
- <el-dialog :before-close="simEscHandler" :visible.sync="SimidialogVisible" append-to-body title="涓恒�愮浉浼奸」鏌ヨ瑙勫垯銆戦�夊彇鍊�">
- <template>
- <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
- <el-option
- v-for="item in SelectOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- style="width: 150px">
- </el-option>
- </el-select>
- <el-input v-model="SelectFInd" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" style="width: 260px;margin-left: 15px"></el-input>
- <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SimSelectFindeHandler">鏌ヨ
- </el-button>
- </template>
- <avue-crud :data="simData" :option="Option" @row-click="simSelect">
- <template slot="radio" slot-scope="{row}">
- <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
- </el-radio>
- </template>
- </avue-crud>
- <div style="height: 30px">
- <div
- style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px ">
- 宸茶缃殑鍊间负:[{{
- this.TreeAddform.codeResembleRuleOidName == '' ? '鏈缃��' : this.TreeAddform.codeResembleRuleOidName
- }}]
- </div>
- <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
- <el-button size="small" type="primary" @click="simHandlerClick">纭畾</el-button>
- <el-button size="small" @click="simEscHandler">鍙栨秷</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 涓氬姟绫诲瀷-->
- <el-dialog :before-close="BtmEscHandler" :visible.sync="BtmdialogVisible" append-to-body title="涓恒�愪笟鍔$被鍨嬭鍒欍�戦�夊彇鍊�">
- <template>
- <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px !important;">
- <el-option
- v-for="item in masterSelectOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- style="width: 130px">
- </el-option>
- </el-select>
- <el-input v-model="SelectFInd" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" style="width: 260px;margin-left: 15px"></el-input>
- <el-button plain size="small" style="margin-left: 20px" type="primary" @click="BtmSelectFindeHandler">鏌ヨ
- </el-button>
- </template>
- <avue-crud :data="BtmData" :option="masterOption" @row-click="btmSelect">
- <template slot="radio" slot-scope="{row}">
- <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
- </el-radio>
- </template>
- </avue-crud>
- <div style="height: 30px">
- <div
- style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px ">
- 宸茶缃殑鍊间负:[{{ this.TreeAddform.btmTypeName }}]
- </div>
- <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
- <el-button size="small" type="primary" @click="btmHandlerClick">纭畾</el-button>
- <el-button size="small" @click="BtmEscHandler">鍙栨秷</el-button>
- </div>
- </div>
- </el-dialog>
+ <ThemeChildren
+ ref="ThemeKeyChildren"
+ :SelectOption="SelectOption"
+ :TreeAddform="TreeAddform"
+ :visible.sync="KeydialogVisible"
+ code-lcstatus="Enabled"
+ codeName="codeKeyAttrRepeatOidName"
+ codeType="codekeyattrrepeat"
+ dialogTitle="鍏抽敭灞炴�ф煡璇㈣鍒�"
+ @defineHandler="handlerDefine"
+ ></ThemeChildren>
+ <!-- 鐩镐技椤规煡璇㈣鍒� -->
+ <ThemeChildren
+ ref="ThemeSimChildren"
+ :SelectOption="SelectOption"
+ :TreeAddform="TreeAddform"
+ :visible.sync="SimidialogVisible"
+ code-lcstatus="Enabled"
+ codeName="codeResembleRuleOidName"
+ codeType="coderesemblerule"
+ dialogTitle="鐩镐技椤规煡璇㈣鍒�"
+ @defineHandler="handlerDefine"
+ ></ThemeChildren>
+ <!-- 涓氬姟绫诲瀷 -->
+ <ThemeChildren
+ ref="ThemeBtmChildren"
+ :SelectOption="btmSelectOption"
+ :TreeAddform="TreeAddform"
+ :visible.sync="BtmdialogVisible"
+ codeName="btmTypeName"
+ codeType="btmCode"
+ dialogTitle="涓氬姟绫诲瀷"
+ @defineHandler="handlerDefine"
+ ></ThemeChildren>
<!-- 瀵煎嚭-->
<ThemeImport :codeClassifyOid="this.codeClassifyOid" :visible.sync="ThemeImportVisible"></ThemeImport>
</basic-container>
@@ -399,15 +364,24 @@
upVersion,
stopLose,
startRelease,
- exportClassify
+ exportClassify,
+ flowingDependencyGen
} from "@/api/template/templateAttr";
import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master'
import func from "@/util/func";
import {mapGetters} from "vuex";
+import ClassifyAuth from './ClassifyAuthDialog.vue';
+import {getAuthButtonList} from '@/api/system/classifyAuth'
+import ThemeChildren from '@/components/FormTemplate/ThemeChildren'
+
export default {
+ components: {ClassifyAuth, ThemeChildren},
name: "classifyTrees.vue",
data() {
return {
+ allButtons: Boolean,
+ btnAuthList: [],
+ activeName: 'first',
masterRow: null,
AddLoading: false,
// 瀹氫箟涓�涓彉閲忔潵淇濆瓨鏍戣姹傜殑鏁伴噺
@@ -422,94 +396,24 @@
editTreeFLagCode: false,
//缂栫爜瑙勫垯
MasterdialogVisible: false,
- masterData: [],
- masterSelectList: [],
- masterName: "",
- masterOid: "",
- //鍏抽敭灞炴�tmTypeId
+ //鍏抽敭灞炴��
KeydialogVisible: false,
- KeyName: "",
- KeyOid: "",
- KeyData: [],
- KeySelectLIst: [],
//鐩镐技椤�
- simName: "",
- simOid: "",
- simData: [],
SimidialogVisible: false,
- simSelectList: [],
//涓氬姟绫诲瀷
- btmName: "",
- btmOid: "",
- BtmData: [],
BtmdialogVisible: false,
- btmSelectList: [],
- masterOption: {
- addBtn: false,
- index: true,
- border: true,
- menu: false,
- height: 380,
- column: [
- {
- label: '',
- prop: 'radio',
- width: 60,
- display: false
- },
- {
- label: '涓氬姟绫诲瀷缂栧彿',
- prop: 'id'
- },
- {
- label: '涓氬姟绫诲瀷鍚嶇О',
- prop: 'name'
- },
- {
- label: '鎻忚堪',
- prop: 'description'
- }
- ]
- },
- Option: {
- addBtn: false,
- index: true,
- columnBtn:false,
- border: true,
- menu: false,
- height: 380,
- column: [
- {
- label: '',
- prop: 'radio',
- width: 60,
- display: false
- },
- {
- label: '鑻辨枃鍚嶇О',
- prop: 'id'
- },
- {
- label: '涓枃鍚嶇О',
- prop: 'name'
- },
- {
- label: '鎻忚堪',
- prop: 'description'
- }
- ]
- },
SelectOption: [
+ {
+ value: 'id',
+ label: '鑻辨枃鍚嶇О',
+ },
{
value: 'name',
label: '涓枃鍚嶇О'
- },
- {
- value: 'id',
- label: '鑻辨枃鍚嶇О'
}
+
],
- masterSelectOption: [
+ btmSelectOption: [
{
value: 'id',
label: '涓氬姟绫诲瀷缂栧彿'
@@ -519,8 +423,6 @@
label: '涓氬姟绫诲瀷鍚嶇О'
},
],
- SelectValue: "id",
- SelectFInd: "",
addFlag: false,
// 琛ㄦ牸褰撳墠琛宨d
crudOid: "",
@@ -566,6 +468,10 @@
TreeEditFormVisible: false,
//娣诲姞瀵硅瘽妗�
TreeAddFormVisible: false,
+ //鍒嗙被鎺堟潈瀵硅瘽妗�
+ classifyAuthVisible: false,
+ //鏁版嵁鎺堟潈瀵硅瘽妗�
+ dataAuthVisible: false,
//褰撳墠鐐瑰嚮椤�
nodeClickList: "",
ClonenodeClickList: "",
@@ -585,7 +491,9 @@
//缂栫爜瑙勫垯
codeRuleOidName: "",
//瀛樺偍鐨勪笟鍔$被鍨�
- btmTypeName: ""
+ btmTypeName: "",
+ codeKeyAttrValue: true,
+ isParticipateCheck: 1
},
rules: {
id: [
@@ -605,6 +513,7 @@
Treedata: [],
CloneTreedata: [],
Treeoption: {
+ height:'auto',
addBtn: false,
editBtn: false,
delBtn: false,
@@ -666,7 +575,7 @@
CloneSelect: [],
//鍏嬮殕妯℃澘option
ClonecrudTreeOption: {
- columnBtn:false,
+ columnBtn: false,
index: true,
border: true,
menu: false,
@@ -735,7 +644,7 @@
}
],
//浼犻�掔粰瀛愮粍浠跺姩鎬佹覆鏌撶殑鏁版嵁
- TreeList: {},
+ TreeEditObj: {},
codeClassifyOid: "",
upAndStopAndStartData: {
upVersion: {
@@ -759,6 +668,8 @@
},
//妯℃澘绠$悊缂栬緫
showEditBtn: false,
+ //浼犻�掔粰鍒嗙被鎺堟潈瀛愮粍浠跺璇濇鐨勫綋鍓嶉�変腑鐨勫垎绫昏妭鐐逛俊鎭�
+ classifyData: "",
}
},
watch: {},
@@ -768,36 +679,47 @@
const treeEle = this.$refs.tree.$el
treeEle.addEventListener('click', (e) => {
if (e.target.nodeName !== 'SPAN') {
- this.$refs.tree.setCurrentKey(null)
- this.nodeClickList = {}
- this.TreeList = []
+ this.$refs.tree.setCurrentKey(null);
+ this.nodeClickList = {};
this.TreeFlagCode = true;
+ this.allButtons = false;
+ // this.$nextTick(()=>{
+ // this.btnAuthList = [];
+ // })
}
}, true)
},
computed: {
...mapGetters(["permission"]),
- permissionList(){
- return{
- TreeAddStatus:this.vaildData(this.permission.classifyTree.tree_add,false),
- TreeEditStatus:this.vaildData(this.permission.classifyTree.tree_edit,false),
- TreeDelStatus:this.vaildData(this.permission.classifyTree.tree_delete,false),
- flushedStatus:this.vaildData(this.permission.classifyTree.tree_break,false),
- EnableStatus:this.vaildData(this.permission.classifyTree.tree_enable,false),
- DeactivateStatus:this.vaildData(this.permission.classifyTree.tree_stop,false),
- ImportExcelStatus:this.vaildData(this.permission.classifyTree.tree_import,false),
- ExportExcelStatus:this.vaildData(this.permission.classifyTree.tree_export,false),
- FindStatus:this.vaildData(this.permission.classifyTree.manage_search,false),
- TemRefreshStatus:this.vaildData(this.permission.classifyTree.manage_break,false),
- CloneBtnStuatus:this.vaildData(this.permission.classifyTree.manage_clone,false),
+ permissionList() {
+ return {
+ TreeAddStatus: this.vaildData(this.permission.classifyTree.tree_add, false),
+ TreeEditStatus: this.vaildData(this.btnAuthList.tree_edit, false),
+ TreeDelStatus: this.vaildData(this.btnAuthList.tree_delete, false),
+ flushedStatus: this.vaildData(this.btnAuthList.tree_break, false),
+ EnableStatus: this.vaildData(this.btnAuthList.tree_enable, false),
+ DeactivateStatus: this.vaildData(this.btnAuthList.tree_stop, false),
+ ImportExcelStatus: this.vaildData(this.btnAuthList.tree_import, false),
+ ExportExcelStatus: this.vaildData(this.btnAuthList.tree_export, false),
+ FindStatus: this.vaildData(this.btnAuthList.manage_search, false),
+ TemRefreshStatus: this.vaildData(this.btnAuthList.manage_break, false),
+ CloneBtnStuatus: this.vaildData(this.btnAuthList.manage_clone, false),
+ flowingBtnStuatus: this.vaildData(this.btnAuthList.tree_flowing, false),
+ classifyAuth: this.vaildData(this.btnAuthList.classify_auth, false),
}
+ },
+ treeStyle() {
+ return {
+ height: this.allButtons ? '610px' : '690px',
+ };
},
crudTreeOption() {
return {
index: true,
border: true,
- columnBtn:false,
- height: 180,
+ columnBtn: false,
+ height: 150,
+ refreshBtn: false,
addBtn: this.Formlist.length <= 0 && this.nodeClickList != "",
editBtn: false,
delBtn: false,
@@ -852,33 +774,38 @@
created() {
},
methods: {
- //瀛樺偍鐨勪笟鍔$被鍨嬪叧闂�
- BtmEscHandler() {
- this.SelectFInd = '';
- this.SelectValue = 'id';
- this.masterRow = null;
- this.BtmdialogVisible = false;
+ // 鍒嗙被鎺堟潈瀵硅瘽妗嗘墦寮�
+ classifyAuthHandler() {
+ if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) {
+ this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒')
+ return;
+ }
+ // this.classifyData = this.nodeClickList;
+ this.classifyAuthVisible = true;
},
- //鐩镐技椤瑰叧闂�
- simEscHandler() {
- this.SelectFInd = '';
- this.SelectValue = 'id';
- this.masterRow = null;
- this.SimidialogVisible = false;
+ // 鏁版嵁鎺堟潈瀵硅瘽妗嗘墦寮�
+ dataAuthHandler() {
+ if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) {
+ this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒')
+ return;
+ }
+ // this.classifyData = this.nodeClickList;
+ this.dataAuthVisible = true;
},
- //鍏抽敭灞炴�у叧闂�
- KeyEscHandler() {
- this.SelectFInd = '';
- this.SelectValue = 'id';
- this.masterRow = null;
- this.KeydialogVisible = false;
+ flowingDependHandler() {
+ if (this.nodeClickList.length <= 0) {
+ this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒')
+ return;
+ }
+ flowingDependencyGen(this.nodeClickList.oid).then(res => {
+ this.$message.success('鎿嶄綔鎴愬姛')
+ }).catch(res => {
+ this.$message.error(res)
+ })
},
- //缂栫爜瑙勫垯鍏抽棴
- masterEscHandler() {
- this.SelectFInd = '';
- this.SelectValue = 'id';
- this.masterRow = null;
- this.MasterdialogVisible = false;
+ // switch
+ switchChange() {
+ this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0;
},
// 鍏抽棴寮圭獥
/** 瀵煎叆 */
@@ -895,183 +822,60 @@
this.$message.warning('璇峰厛閫夋嫨瑕佸鍑虹殑涓婚搴撳垎绫�')
}
},
+ //鏍戞柊澧炲弬鐓у瓙缁勪欢浜嬩欢
+ handlerDefine(val) {
+ const codeTypeMap = {
+ coderule: {
+ nameKey: 'codeRuleOidName',
+ oidKey: 'codeRuleOid'
+ },
+ codekeyattrrepeat: {
+ nameKey: 'codeKeyAttrRepeatOidName',
+ oidKey: 'codeKeyAttrRepeatOid'
+ },
+ coderesemblerule: {
+ nameKey: 'codeResembleRuleOidName',
+ oidKey: 'codeResembleRuleOid'
+ },
+ btmCode: {
+ nameKey: 'btmTypeName',
+ oidKey: 'btmTypeId',
+ clearValidate: true
+ }
+ };
+
+ const codeType = codeTypeMap[val.codeType];
+ if (codeType) {
+ if (codeType.clearValidate) {
+ this.$refs.myForm.clearValidate();
+ }
+ this.$set(this.TreeAddform, codeType.nameKey, val.crudName);
+ this.$set(this.TreeAddform, codeType.oidKey, val.crudOid);
+ }
+ },
//缂栫爜瑙勫垯澶辩劍
CodeFoucus() {
this.MasterdialogVisible = true;
- this.MasterdefaultRend()
+ this.$refs.ThemeMasterChildren.defaultSearchRend()
},
- //缂栫爜澶氶��
- masterSelect(row) {
- this.masterRow = row.$index;
- this.masterSelectList = row;
- this.masterName = row.name;
- this.masterOid = row.oid;
-
- },
- //缂栫爜瑙勫垯鏌ヨ
- SelectFindeHandler() {
- const masterParameter = {};
- masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
- this.MasterdefaultRend(masterParameter)
- },
- //缂栫爜瑙勫垯纭畾
- MasterHandlerClick() {
- if (this.masterSelectList.length > 1) {
- this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�')
- } else if (this.masterSelectList.length <= 0) {
- this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
- } else {
- this.MasterdialogVisible = false;
- this.masterSelectList = []
- this.$set(this.TreeAddform, 'codeRuleOidName', this.masterName)
- this.$set(this.TreeAddform, 'codeRuleOid', this.masterOid)
- this.$emit('MasterHandler', this.loneTreeNewForm)
- this.masterRow=null;
- }
- },
- //缂栫爜鎺ュ彛
- MasterdefaultRend(masterParameter) {
- defaultReferDataGrid({
- referType: 'coderule',
- isMuti: 'false',
- 'conditionMap["lcstatus"]': 'Released',
- 'limit':'-1',
- ...masterParameter
- }).then(res => {
- this.masterData = res.data.records;
- })
- },
+ //鍏抽敭灞炴�уけ鐒�
Keyfouce() {
this.KeydialogVisible = true;
- this.KeydefaultRend()
+ this.$refs.ThemeKeyChildren.defaultSearchRend();
},
- //鍏抽敭灞炴�х‘瀹�
- KeyHandlerClick() {
- if (this.KeySelectLIst.length > 1) {
- this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�')
- } else if (this.KeySelectLIst.length <= 0) {
- this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
- } else {
- this.KeydialogVisible = false;
- this.KeySelectLIst = []
- this.$set(this.TreeAddform, 'codeKeyAttrRepeatOidName', this.KeyName)
- this.$set(this.TreeAddform, 'codeKeyAttrRepeatOid', this.KeyOid)
- this.masterRow=null;
- }
- },
- //鍏抽敭灞炴�ф煡璇�
- KeySelectFindeHandler() {
- const masterParameter = {};
- masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
- this.KeydefaultRend(masterParameter)
- },
- //鍏抽敭灞炴�ф帴鍙�
- KeydefaultRend(masterParameter) {
- defaultReferDataGrid({
- referType: 'codekeyattrrepeat',
- isMuti: 'false',
- 'conditionMap["lcstatus"]': 'Enabled',
- 'limit':'-1',
- ...masterParameter
- }).then(res => {
- this.KeyData = res.data.records;
- })
- },
- // 鍏抽敭澶氶��
- KeySelect(row) {
- this.masterRow = row.$index;
- this.KeySelectLIst = row;
- this.KeyName = row.name;
- this.KeyOid = row.oid;
- },
- //鍏抽敭澶辩劍
+ //鐩镐技椤瑰け鐒�
simFouce() {
this.SimidialogVisible = true;
- this.simdefaultRend()
- },
- //鐩镐技椤圭‘瀹�
- simHandlerClick() {
- if (this.simSelectList.length > 1) {
- this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�')
- } else if (this.simSelectList.length <= 0) {
- this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
- } else {
- this.SimidialogVisible = false;
- this.simSelectList = []
- this.$set(this.TreeAddform, 'codeResembleRuleOidName', this.simName)
- this.$set(this.TreeAddform, 'codeResembleRuleOid', this.simOid)
- this.$emit('MasterHandler', this.loneTreeNewForm)
- this.masterRow=null;
- }
- },
- //鐩镐技椤规煡璇�
- SimSelectFindeHandler() {
- const masterParameter = {};
- masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
- this.simdefaultRend(masterParameter)
- },
- // 鐩镐技椤瑰閫�
- simSelect(row) {
- this.masterRow = row.$index;
- this.simSelectList = row;
- this.simName = row.name;
- this.simOid = row.oid;
- },
- //鐩镐技椤归」鎺ュ彛
- simdefaultRend(masterParameter) {
- defaultReferDataGrid({
- referType: 'coderesemblerule',
- isMuti: 'false',
- 'conditionMap["lcstatus"]': 'Enabled',
- 'limit':'-1',
- ...masterParameter
- }).then(res => {
- this.simData = res.data.records;
- })
+ this.$refs.ThemeSimChildren.defaultSearchRend();
},
//涓氬姟绫诲瀷澶辩劍
btmFoucus() {
this.BtmdialogVisible = true;
- this.btmdefaultRend()
- },
- //涓氬姟绫诲瀷纭畾
- btmHandlerClick() {
- if (this.btmSelectList.length > 1) {
- this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�')
- } else if (this.btmSelectList.length <= 0) {
- this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
- } else {
- this.$refs.myForm.clearValidate();
- this.BtmdialogVisible = false;
- this.btmSelectList = []
- this.$set(this.TreeAddform, 'btmTypeName', this.btmName)
- this.$set(this.TreeAddform, 'btmTypeId', this.btmOid)
- this.$emit('MasterHandler', this.loneTreeNewForm)
- this.masterRow=null;
- }
- },
- //涓氬姟绫诲瀷鏌ヨ
- BtmSelectFindeHandler() {
- const masterParameter = {};
- masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
- this.btmdefaultRend(masterParameter);
- },
- //涓氬姟绫诲瀷澶氶��
- btmSelect(row) {
- this.masterRow = row.$index;
- this.btmSelectList = row;
- this.btmName = row.name;
- this.btmOid = row.id;
- },
- //涓氬姟绫诲瀷鎺ュ彛
- btmdefaultRend(masterParameter) {
- referDataGrid({valueField: 'id', isMuti: 'false','limit':'-1', ...masterParameter}).then(res => {
- this.BtmData = res.data.data.records
- })
+ this.$refs.ThemeBtmChildren.btmDefaultRend();
},
//瀛愪紶鐖�
MasterHandler(val) {
- this.TreeList = val;
+ this.TreeEditObj = val;
},
rowHandle(row, column) {
this.selectRow = row.$index;
@@ -1082,26 +886,38 @@
},
//鍒嗙被鏍戞暟鎹鐞�
getAttr() {
- getAtrrList().then(res => {
- this.Treedata = res.data;
- this.CloneTreedata = res.data;
- this.Treedata.forEach(() => {
- for (let i = 0; i < this.Treedata.length; i++) {
- this.Treedata[i].value = i;
- }
- })
- //璋冪敤淇敼灞炴�у悕鏂规硶
- this.ModifyProperties(this.CloneTreedata, 'name', 'label');
- this.CloneTreedata = this.CloneTreedata.map(item => {
- if (item.attributes.lcStatus === "Disabled") {
- item.label += '銆愬仠鐢ㄣ��';
- }
- return item;
- });
- }).catch(res => {
- this.$message.error(res)
-
- })
+ this.loading = true;
+ return new Promise((resolve, reject) => {
+ let conditionMaps = {};
+ conditionMaps["conditionMap[authType]"] = "classify_auth";
+ conditionMaps["conditionMap[buttonCode]"] = "classifyTree";
+ // 鍒嗙被鎺堟潈涓槸鍚﹀叿澶囨煡鐪嬫潈闄�
+ conditionMaps["conditionMap[menuCode]"] = "classify_view";
+ getAtrrList(conditionMaps)
+ .then(res => {
+ this.Treedata = res.data;
+ this.CloneTreedata = res.data;
+ this.Treedata.forEach(() => {
+ for (let i = 0; i < this.Treedata.length; i++) {
+ this.Treedata[i].value = i;
+ }
+ })
+ //璋冪敤淇敼灞炴�у悕鏂规硶
+ this.ModifyProperties(this.CloneTreedata, 'name', 'label');
+ this.CloneTreedata = this.CloneTreedata.map(item => {
+ if (item.attributes.lcStatus === "Disabled") {
+ item.label += '銆愬仠鐢ㄣ��';
+ }
+ return item;
+ });
+ this.loading = false;
+ resolve(); // 瀹屾垚璇锋眰锛岃皟鐢╮esolve鏂规硶
+ })
+ .catch(error => {
+ this.$message.error(error)
+ reject(error); // 璇锋眰鍑洪敊锛岃皟鐢╮eject鏂规硶
+ });
+ });
},
//瀹氫箟涓�涓慨鏀规暟鎹睘鎬у悕鐨勬柟娉�
ModifyProperties(obj, oldName, newName) {
@@ -1136,39 +952,43 @@
},
//鏍戣妭鐐瑰彇娑堜簨浠�
TreeEscHandler() {
- this.TreeAddform = {};
+ for (let key in this.TreeAddform) {
+ if (key !== 'codeKeyAttrValue' && key !== 'isParticipateCheck') {
+ this.TreeAddform[key] = "";
+ }
+ }
+ this.TreeAddform.codeKeyAttrValue = true;
+ this.TreeAddform.isParticipateCheck = 1;
this.TreeAddFormVisible = false;
// 鍏抽棴寮圭獥娓呯┖鏍¢獙
this.$refs.myForm.clearValidate();
},
//鏍戣妭鐐规坊鍔犱簨浠�
- TreeAddHandler() {
+ async TreeAddHandler() {
if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
this.$message.warning('璇疯緭鍏ュ唴瀹癸紒');
- } else {
+ return;
+ }
+ try {
const data = this.TreeAddform;
this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
- TreeSave(data)
- .then(() => {
- this.$message({
- type: "success",
- message: "娣诲姞鎴愬姛!",
- });
- Object.keys(this.TreeAddform).forEach(key => {
- this.TreeAddform[key] = "";
- });
- this.getAttr();
- this.TreeAddFormVisible = false;
- //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
- this.ProData = [];
- this.Formlist = [];
- })
- .catch((res) => {
- this.$message({
- type: "warning",
- message: res,
- });
- });
+ await TreeSave(data)
+ this.$message.success("娣诲姞鎴愬姛!");
+ Object.keys(this.TreeAddform).forEach(key => {
+ this.TreeAddform[key] = "";
+ });
+ this.TreeAddform.codeKeyAttrValue = true;
+ this.TreeAddform.isParticipateCheck = 1;
+ this.getAttr();
+ this.TreeAddFormVisible = false;
+ //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
+ this.ProData = [];
+ this.Formlist = [];
+ } catch (res) {
+ this.$message({
+ type: "warning",
+ message: res,
+ });
}
},
//鏍戣妭鐐瑰垹闄ゆ寜閽�
@@ -1239,83 +1059,110 @@
}
},
//鏍戝埛鏂�
- flushed() {
- this.loading = true
- this.getAttr()
- setTimeout(() => {
- this.loading = false;
- this.nodeClickList = ""
- }, 600);
+ async flushed() {
+ await this.getAttr()
+ this.$refs.tree.setCurrentKey(null);
+ this.nodeClickList = {};
+ this.TreeEditObj = {};
+ this.TreeFlagCode = true;
},
//鍚敤鍜屽仠鐢ㄩ兘鍏堝垽鏂姸鎬�
//鍚敤
- Enable() {
+ async Enable() {
if (Object.keys(this.nodeClickList).length < 1) {
- this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�')
- } else {
- if (this.FlagObj.lcStatus == "Enabled") {
- this.$message({
- type: 'warning',
- message: '褰撳墠鍒嗙被涓嶆槸鍋滅敤鐘舵��'
- });
- } else {
- this.$confirm('鏄惁灏嗗瓙鍒嗙被涓�骞跺惎鐢紵', '鎻愮ず', {
- confirmButtonText: '鏄�',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- TreeEnable(this.nodeClickList).then(() => {
- this.$message({
- type: 'success',
- message: '鍚敤鎴愬姛!'
- });
- this.getAttr()
- })
- }).catch(() => {
+ this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�');
+ return;
+ }
+ if (this.FlagObj.lcStatus == "Enabled") {
+ this.$message({
+ type: 'warning',
+ message: '褰撳墠鍒嗙被涓嶆槸鍋滅敤鐘舵��'
+ });
+ return;
+ }
+ this.loading = true;
+ try {
+ const confirmResult = await this.$confirm('鏄惁灏嗗瓙鍒嗙被涓�骞跺惎鐢紵', '鎻愮ず', {
+ confirmButtonText: '鏄�',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ });
+ if (confirmResult) {
+ await TreeEnable(this.nodeClickList).then(res => {
this.$message({
- type: 'info',
- message: '宸插彇娑堝惎鐢�'
+ type: 'success',
+ message: '鍚敤鎴愬姛!'
});
+ })
+ await this.getAttr();
+
+ } else {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝惎鐢�'
});
}
+ } catch (error) {
+ // console.error(error);
+ } finally {
+ this.loading = false;
+ }
+ },
+
+ async Deactivate() {
+ if (Object.keys(this.nodeClickList).length < 1) {
+ this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�');
+ return;
}
- },
- //鍋滅敤
- Deactivate() {
- if (Object.keys(this.nodeClickList).length < 1) {
- this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�')
- } else {
- if (this.FlagObj.lcStatus === "Disabled") {
- this.$message({
- type: 'warning',
- message: '褰撳墠鍒嗙被涓嶆槸鍚敤鐘舵��!'
- });
- } else {
- this.$confirm('鏄惁鍋滅敤褰撳墠鍒嗙被锛屽仠鐢ㄥ悗锛屽瓙鍒嗙被涔熷皢涓嶈兘琚娇鐢紝鏄惁缁х画锛�', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- TreeDeactivate(this.nodeClickList).then(() => {
- this.$message({
- type: 'success',
- message: '鍋滅敤鎴愬姛!'
- });
- this.nodeClickList['flag'] = true;
- this.getAttr()
- })
- }).catch(() => {
+ if (this.FlagObj.lcStatus === "Disabled") {
+ this.$message({
+ type: 'warning',
+ message: '褰撳墠鍒嗙被涓嶆槸鍚敤鐘舵��!'
+ });
+ return;
+ }
+
+ this.loading = true;
+ try {
+ const confirmResult = await this.$confirm('鏄惁鍋滅敤褰撳墠鍒嗙被锛屽仠鐢ㄥ悗锛屽瓙鍒嗙被涔熷皢涓嶈兘琚娇鐢紝鏄惁缁х画锛�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ });
+ if (confirmResult) {
+ await TreeDeactivate(this.nodeClickList).then(res => {
this.$message({
- type: 'info',
- message: '宸插彇娑堝仠鐢�'
+ type: 'success',
+ message: '鍋滅敤鎴愬姛!'
});
+ })
+ this.nodeClickList['flag'] = true;
+ await this.getAttr();
+ } else {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝仠鐢�'
});
}
+ } catch (error) {
+ // console.error(error);
+ } finally {
+ this.loading = false;
}
},
//鏍戠偣鍑讳簨浠�
async nodeClick(data) {
+ const response = this.findTheTopLevelNode(data,this.Treedata)
+ this.classifyData = response;
+ // console.log(response)
+ // console.log('response',response.attributes.id)
+ this.allButtons = true;
+ getAuthButtonList({classifyId: data.oid, code: "classifyTree", authType: "classify_auth"}).then(res => {
+ this.btnAuthList = res.data.data;
+ }).catch(error => {
+ console.log(error)
+ })
//鎿嶄綔鏂板鍜屼慨鏀圭殑涓氬姟绫诲瀷闅愯棌
this.TreeFlagCode = !data;
this.editTreeFLagCode = !data.parentId;
@@ -1345,12 +1192,42 @@
this.ProData = [];
this.crudOid = ''
}
- this.TreeList = res3.data.data;
+ this.TreeEditObj = res3.data.data;
+ if (this.TreeEditObj.isParticipateCheck === null || this.TreeEditObj.isParticipateCheck === undefined || this.TreeEditObj.isParticipateCheck === "") {
+ this.$set(this.TreeEditObj, "isParticipateCheck", 1)
+ return
+ }
} catch (error) {
this.$message.error(error);
}
},
+ // 閫掑綊鏌ユ壘椤跺眰鑺傜偣Id
+ findTheTopLevelNode(data,TreeData){
+ if(data.parentId === ""){
+ return data;
+ }
+ const parentNode = this.findParentNode(data.parentId, TreeData);
+ if (parentNode) {
+ return this.findTheTopLevelNode(parentNode, TreeData); // 缁х画鏌ユ壘鐖惰妭鐐�
+ }
+ },
+ // 閫掑綊鏌ユ壘鍑烘潵澶氬眰鑺傜偣鐨勭埗鑺傜偣
+ findParentNode(parentId, TreeData){
+ for (const node of TreeData) {
+ if (node.oid === parentId) {
+ return node;
+ }
+ // 濡傛灉褰撳墠鑺傜偣杩樻湁瀛愯妭鐐癸紝缁х画鍘绘煡瀛愯妭鐐圭殑鐖惰妭鐐�
+ if (node.children) {
+ const parentNode = this.findParentNode(parentId, node.children);
+ if (parentNode) {
+ return parentNode;
+ }
+ }
+ }
+ return null;
+ },
async gridCode() {
try {
const res = await gridCodeClassifyTemplateAttr({
@@ -1375,12 +1252,12 @@
}
},
treeClick(e) {
- console.log(e);
+ // console.log(e);
},
//鍩烘湰淇℃伅琛ㄥ崟鍒锋柊
referTreeForm() {
getObjectByOid(this.nodeClickList.oid).then(res => {
- this.TreeList = res.data.data;
+ this.TreeEditObj = res.data.data;
}).catch(res => {
this.$message.error(res)
})
@@ -1626,9 +1503,9 @@
</script>
<style lang="scss" scoped>
-.el-container {
- height: 100%;
-}
+//.el-container {
+// height: 100%;
+//}
.el-aside {
//height: calc(100% - 30px);
@@ -1656,4 +1533,25 @@
width: 500px;
}
-</style>
\ No newline at end of file
+.headerCon {
+ .el-button + .el-button {
+ margin-left: 5px;
+ }
+
+ .el-button {
+ margin-top: 5px;
+ }
+}
+
+.headerCon > .el-button:nth-child(5) {
+ margin-left: 0;
+}
+
+.headerCon > .el-button:nth-child(9) {
+ margin-left: 0;
+}
+///deep/.el-scrollbar__bar.is-vertical{
+// width: 8px;
+//}
+
+</style>
--
Gitblit v1.9.3