From fc31bda418c337ba9d3650186b8f1547ba9c5ad0 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期六, 25 五月 2024 22:39:58 +0800 Subject: [PATCH] 表格错行 --- Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 1128 +++++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 744 insertions(+), 384 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue index 5c1747a..bfa9643 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue @@ -1,64 +1,116 @@ <template> <div> - <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app"> - <el-button-group> - <!--鏂板--> - <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" size="small" type="primary" icon="el-icon-plus" plain @click="busineHandle">娣诲姞 {{ msg }}</el-button> - <!-- 鍏ㄥ睆缂栬緫--> - <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">鍏ㄥ睆缂栬緫</el-button> - <!-- 楠岃瘉瑙勫垯--> - <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" @click="ruleAddHandler">楠岃瘉瑙勫垯</el-button> - <!-- 灞炴�у垎缁�--> - <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button> - </el-button-group> - <el-button-group> - <!-- 淇濆瓨--> - <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click.prevent="addsHandler" icon="el-icon-check">淇濆瓨</el-button> - <!-- 棰勮鎺掑簭--> - <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button> - <!-- 鍒犻櫎--> - <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">鍒犻櫎</el-button> - <!-- 閲嶇疆--> - <el-button size="small" @click="reset" icon="el-icon-refresh-right">閲嶇疆</el-button> - </el-button-group> + <div v-if="this.crudArrayFlag" class="app" + style="display: flex;flex-wrap: wrap; display: inline-block;height: 80px"> <el-button-group> <!--鏂板--> - <!-- 鍒嗙被娉ㄥ叆--> - <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" size="small" @click="injectBtn">鍒嗙被娉ㄥ叆</el-button> - <!-- 缁勫悎瑙勫垯--> - <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" @click="isShowHandler">缁勫悎瑙勫垯</el-button> - <!-- 鏋氫妇娉ㄥ叆--> - <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" size="small" @click="enmuVisHandle">鏋氫妇娉ㄥ叆</el-button> - <!-- 绾ц仈灞炴��--> - <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">绾ц仈灞炴��</el-button> + <span v-if="permissionList.busineStatus"> + <el-button + v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" + icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle">娣诲姞 {{ msg }} + </el-button> + </span> + <!-- 鍏ㄥ睆缂栬緫--> + <span v-if="permissionList.fullscreenStatus"> + <el-button + v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" + icon="el-icon-full-screen" size="small" @click="fullscreenHandle">鍏ㄥ睆缂栬緫 + </el-button> + </span> + <span v-if="permissionList.ruleStatus"> + <!-- 楠岃瘉瑙勫垯--> + <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" + @click="ruleAddHandler">楠岃瘉瑙勫垯 + </el-button> + </span> + <span v-if="permissionList.attrStatus"> + <!-- 灞炴�у垎缁�--> + <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" + @click="attrVisibleHandle">灞炴�у垎缁� + </el-button> + </span> + </el-button-group> + <el-button-group> + <span v-if="permissionList.saveStatus"> + <!-- 淇濆瓨--> + <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain + size="small" + type="success" @click.prevent="addsHandler">淇濆瓨 + </el-button> + </span> + <!-- 棰勮鎺掑簭--> + <el-button v-if="permissionList.orderStatus" icon="el-icon-arrow-down" size="small" @click="orderHandle">棰勮鎺掑簭 + </el-button> + <span v-if="permissionList.removeStatus"> + <!-- 鍒犻櫎--> + <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-delete" size="small" + @click="CrudRemove">鍒犻櫎 + </el-button> + </span> + <!-- 閲嶇疆--> + <el-button v-if="permissionList.resetStatus" icon="el-icon-refresh-right" size="small" @click="resetHandler"> + 閲嶇疆 + </el-button> + </el-button-group> + <el-button-group> + <span v-if="permissionList.injectStatus"><!-- 鍒嗙被娉ㄥ叆--> + <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" + size="small" @click="injectBtn">鍒嗙被娉ㄥ叆 + </el-button></span> + <span v-if="permissionList.isShowStatus"> <!-- 缁勫悎瑙勫垯--> + <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" + @click="isShowHandler">缁勫悎瑙勫垯 + </el-button></span> + <span v-if="permissionList.enumStatus"> <!-- 鏋氫妇娉ㄥ叆--> + <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" + size="small" @click="enumVisHandle">鏋氫妇娉ㄥ叆 + </el-button></span> + + <span v-if="permissionList.cascadStatus"> + <!-- 绾ц仈灞炴��--> + <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" + @click="CascadeHandle">绾ц仈灞炴�� + </el-button> + </span> </el-button-group> <el-button-group> - <!-- 鍚屾鍒板叾浠栨ā鏉�--> - <el-button size="small"@click="syncHandle" icon="el-icon-share">鍚屾鍒板叾浠栨ā鏉�</el-button> + <!-- 鍚屾鍒板叾浠栨ā鏉�--> + <el-button v-if="permissionList.syncStatus" icon="el-icon-share" size="small" @click="syncHandle">鍚屾鍒板叾浠栨ā鏉� + </el-button> </el-button-group> <el-button-group> - <!-- 缂栫爜鐢宠棰勮--> - <el-button size="small" icon="el-icon-view" @click="applicationHandle" style="">缂栫爜鐢宠棰勮</el-button> + <!-- 缂栫爜鐢宠棰勮--> + <el-button v-if="permissionList.applicationStatus" icon="el-icon-view" size="small" style="" + @click="applicationHandle">缂栫爜鐢宠棰勮 + </el-button> </el-button-group> <!-- 鏄惁寮�鍚紪杈� --> - <el-button-group> - <el-button size="small" plain icon="el-icon-view" v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" @click="editOpen" >寮�鍚紪杈�</el-button> - </el-button-group> - <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" v-model="selectvalue" placeholder="璇烽�夋嫨"> - <el-option - v-for="item in selectoptions" - :key="item.value" - :label="item.label" - :value="item.value"> - </el-option> - </el-select> - <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="switchvalue" @change="batchSetFlag" active-value="true" style="margin:6px 0 0 10px"> - </el-switch> + <el-button-group> + <el-button + v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" + icon="el-icon-view" plain + size="small" + @click="editOpen">寮�鍚紪杈� + </el-button> + <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="selectvalue" + placeholder="璇烽�夋嫨" + size="small"> + <el-option + v-for="item in selectoptions" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="switchvalue" + active-value="true" style="margin:6px 0 0 10px" @change="batchSetFlag"> + </el-switch> + </el-button-group> </div> -<!-- 寮圭獥--> + <!-- 寮圭獥--> <div> <!-- 缂栫爜鐢宠棰勮--> <FormTemplateDialog @@ -85,14 +137,14 @@ </div> </el-dialog> <!-- 鏋氫妇娉ㄥ叆--> - <el-dialog :visible.sync="enumVisible" append-to-body title="鏋氫妇娉ㄥ叆" :before-close="this.enumBeforeClose"> + <el-dialog :before-close="this.enumBeforeClose" :visible.sync="enumVisible" append-to-body title="鏋氫妇娉ㄥ叆"> <!-- 娓叉煋琛ㄦ牸鍙婃寜閽� --> <!-- 娓叉煋琛ㄦ牸鍙婃寜閽� --> <el-alert - title="璇锋柊澧炲悗鐐瑰嚮鍗曞厓鏍艰緭鍏ユ灇涓炬暟鎹�" - type="success" + :closable="false" style="margin-bottom: 10px;display: inline-block" - :closable="false"> + title="璇锋柊澧炲悗鐐瑰嚮鍗曞厓鏍艰緭鍏ユ灇涓炬暟鎹�" + type="success"> </el-alert> <div> <el-button icon="el-icon-plus" type="primary" @click="addRow">鏂板</el-button> @@ -116,7 +168,7 @@ </el-table-column> <el-table-column fixed="right" label="鎿嶄綔" width="120"> <template slot-scope="scope"> - <el-button size="small" type="text" plain @click="enumDeleteRow"> + <el-button plain size="small" type="text" @click="enumDeleteRow"> 绉婚櫎 </el-button> </template> @@ -151,7 +203,8 @@ <el-radio-group v-model="injectOption.classifyInvokeLevel"> <el-radio label="min">鏈�灏忓眰</el-radio> <el-radio label="max">鎸囧畾灞�</el-radio> - <el-input-number v-if="this.injectOption.classifyInvokeLevel == 'max'" v-model="injectOption.classifyNumber" :max="10" :min="0" + <el-input-number v-if="this.injectOption.classifyInvokeLevel == 'max'" + v-model="injectOption.classifyNumber" :max="10" :min="0" controls-position="right"></el-input-number> </el-radio-group> </el-form-item> @@ -171,7 +224,8 @@ </div> </el-dialog> <!-- 灞炴�у垎缁�--> - <el-dialog :visible.sync="attrVisible" append-to-body :before-close="attrClose" style="width: 800px; left:30vw;top: 10vh ;" + <el-dialog :before-close="attrClose" :visible.sync="attrVisible" append-to-body + style="width: 800px; left:30vw;top: 10vh ;" title="杈撳叆鍒嗙粍鐨勫悕绉�"> <el-form ref="form" label-width="70px"> <el-form-item label="灞炴�у垎缁�"> @@ -222,19 +276,22 @@ </el-container> </el-dialog> <!-- 鍏ㄥ睆缂栬緫--> - <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true" :before-close="escEdit" > - <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" @editCloseChildren="editClose" :editStyleFlag="editStyleFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud> + <el-dialog :before-close="escEdit" :visible.sync="attrEditVisible" append-to-body fullscreen="true"> + <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :btnAuthList="btnAuthList" + :crudArrayFlag="this.crudArrayFlag" :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" + @editCloseChildren="editClose"></attrCrud> </el-dialog> <!-- 缁勫悎瑙勫垯--> - <formula-editor :systemVariableTableData="systemVariableTableData" + <formula-editor :componentRuleText="componentRuleText" + :systemVariableTableData="systemVariableTableData" :thisSceneTableData="thisSceneTableData" :visible.sync="isShowformulaEdit" @updateFormulaContent="updataFormlaContent" - :componentRuleText="componentRuleText" ></formula-editor> <!-- 鏂板 --> <el-dialog :visible.sync="addVisible" append-to-body title="浠庝笟鍔$被鍨嬩腑閫夋嫨灞炴��"> - <avue-crud ref="AddOriginPlace" :data="businessData" :option="businessOption" @selection-change="businessSelect"> + <avue-crud ref="AddOriginPlace" :data="businessData" :option="businessOption" + @selection-change="businessSelect"> <template slot="menuLeft"> <div style="display: flex;"> <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 150px !important;"> @@ -246,7 +303,7 @@ style="width: 150px"> </el-option> </el-select> - <el-input style="width: 400px;margin-left: 20px" v-model="SelectFInd"></el-input> + <el-input v-model="SelectFInd" style="width: 400px;margin-left: 20px"></el-input> <el-button size="small" style="margin-left: 10px" @click="AddFindHandler">鏌ヨ</el-button> </div> </template> @@ -256,48 +313,77 @@ <el-button size="small" type="primary" @click="addVisible=false">鍙栨秷</el-button> </div> </el-dialog> - <!-- 鍙傜収閰嶇疆--> - <refer-config-dialog - :display="referConfigVisble" - @setReferConfigValue="setReferConfigValue" - :referConfigOption="referConfigOption" - ></refer-config-dialog> + <refer-config-dialog + :display="referConfigVisble" + :referConfigOption="referConfigOption" + @setReferConfigValue="setReferConfigValue" + ></refer-config-dialog> + <!--杩戜箟璇嶆煡璇㈣鍒� --> + <el-dialog :visible.sync="synonymVisible" append-to-body title="杩戜箟璇嶆煡璇㈣鍒�"> + <avue-crud v-loading="sysonymLoading" :data="synonymData" :option="synonymOption" @selection-change="sysChange"> + <template slot="lcStatus" slot-scope="{row}"> + <el-tag v-if="row.lcStatus === 'Released'" type="success">鍚敤</el-tag> + <el-tag v-else type="danger">鍋滅敤</el-tag> + </template> + </avue-crud> + <div slot="footer" class="dialog-footer"> + <el-button type="info" @click="sysClear">娓呯┖</el-button> + <el-button type="primary" @click="sysnonymSubmit">纭畾</el-button> + <el-button @click="sysnonymCancel">鍙栨秷</el-button> + </div> + </el-dialog> </div> - <el-table :data="ProData" - style="width: 100%" - :height="this.editStyleFlag? 800 : 343" - @cell-click="handleCellClicks" - @select="selectHandle" - @selection-change="selectionChange" - @row-click="rowClick" - v-if="this.crudArrayFlag" + + <el-table v-if="this.crudArrayFlag" ref="referAttrCrud" v-loading="loading" + :data="ProData" + :header-cell-style="{background:'#FAFAFA',color:'#505050'}" + :height="this.tableHeight" + border + style="width: 100%" + @select="selectHandle" + @cell-click="handleCellClicks" + @selection-change="selectionChange" + @row-click="rowClick" > <el-table-column - type="selection" - width="55" fixed> + :fixed="!editStyleFlag ? 'left' : undefined" + type="selection" width="55"> </el-table-column> <!--<el-table-column fixed label="搴忓彿" type="index" width="55"></el-table-column>--> - <el-table-column v-for="(item,index) in this.option.column" :key="item.id" + <el-table-column v-for="(item,index) in this.option.column" v-if="item.edit !='referName'" + :key="item.id" + :fixed="!editStyleFlag ? item.fixed : undefined" + :formatter="formAttr" :label="item.label" :prop="item.prop" - :formatter="formAttr" - :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" :show-overflow-tooltip="true" :sortable="item.sortable" - :fixed="item.fixed" + :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" align="center" - v-if="item.edit !='referName'" > <template slot-scope="{ row }"> - <el-input ref="inputRef" v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]" - @blur="saveRows" autofocus ></el-input> - <el-input-number size="small" controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" - @blur="saveRows" :style="{width:(item.width-10)+'px'}"></el-input-number> - <el-select v-model="row[item.prop]" filterable allow-create default-first-option slot="prepend" v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " @blur="selectChangeHandler(item.editConfig,index)"> + <el-input + v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" + v-show="!AddCellFlag" + :ref="'input' + row.oid" + v-model="row[item.prop]" + @blur="saveRows(row)" + ></el-input> + <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" + v-show="!AddCellFlag" + v-model="row[item.prop]" + :style="{width:(item.width-10)+'px'}" + controls-position="right" + size="small" @blur="saveRows"></el-input-number> + <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " v-show="!AddCellFlag" + slot="prepend" + v-model="row[item.prop]" :clearable="true" allow-create + default-first-option filterable + @blur="selectChangeHandler(item.editConfig,index)"> <el-option v-for="optionItem in item.data" :key="optionItem.dictValue" @@ -306,7 +392,7 @@ </el-option> </el-select> <el-switch - v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" :disabled="!editOpenFlag" + v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" inactive-value="false"> </el-switch> <span v-else>{{ row[item.prop] }}</span> @@ -330,8 +416,18 @@ </template> <script> -import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr' +import { + AttrByBtm, + gridCodeClassifyTemplateAttr, + batchAddSave, + copyto, + listByFlag, + codeSynonym +} from '@/api/template/templateAttr' import {getList} from "@/api/refer/table"; +import func from "@/util/func"; +import {getCurrentInstance} from "vue"; +import {mapGetters} from "vuex"; export default { name: "attrCrud .vue", @@ -343,16 +439,16 @@ type: String, default: '' }, - checkStatus:{ + checkStatus: { type: Boolean, default: false }, //鎺у埗鏄惁寮�鍚紪杈� - editOpenFlag:{ + editOpenFlag: { type: Boolean, default: false }, - editStyleFlag:{ + editStyleFlag: { type: Boolean, default: false }, @@ -374,84 +470,138 @@ type: Boolean, default: false }, - crudArrayFlag:{ + crudArrayFlag: { type: Boolean, default: false }, + btnAuthList: { + type: Array + } }, - watch:{ - crudOid:{ - handler(newval,oldval){ - if(newval){ - this.editOpenFlag=false + watch: { + crudOid: { + handler(newval, oldval) { + if (newval) { + this.editOpenFlag = false } } }, - crudArray:{ - handler(newval,oldval){ - if(newval != undefined){ - if(newval.length>=1){ - this.crudArrayFlag=true - }else{ - this.crudArrayFlag=false + crudArrayFlag: { + handler(newval, oldval) { + // console.log('crudArrayFlag', newval) + } + }, + crudArray: { + handler(newval, oldval) { + if (newval != undefined) { + if (newval.length >= 1) { + this.crudArrayFlag = true + } else { + this.crudArrayFlag = false } } }, - deep:true, - immediate:true + deep: true, + immediate: true }, - Formlist:{ - handler(newval,oldval){ - if(newval.length === 0){ - this.crudArrayFlag=false + Formlist: { + handler(newval, oldval) { + if (newval.length === 0) { + this.crudArrayFlag = false return } } }, - ProData:{ - handler(newval,oldval){ - if(newval){ - this.loading=true; + ProData: { + handler(newval, oldval) { + if (newval) { + this.loading = true; setTimeout(() => { - this.loading=false + this.loading = false }, 1000); } } }, - 'injectOption.classifyInvokeAttr': function(newVal) { + 'injectOption.classifyInvokeAttr': function (newVal) { if (newVal === "name") { - this.injectOption.classifyInvokeAttrName='鍒嗙被鍚嶇О' + this.injectOption.classifyInvokeAttrName = '鍒嗙被鍚嶇О' } else if (newVal === "id") { - this.injectOption.classifyInvokeAttrName='鍒嗙被浠e彿' + this.injectOption.classifyInvokeAttrName = '鍒嗙被浠e彿' } return ''; }, - editOpenFlag:{ - handler(newval,oldval){ - console.log('editOpenFlag',newval) + editOpenFlag: { + handler(newval, oldval) { + // console.log('editOpenFlag', newval) }, - deep:true, - immediate:true + deep: true, + immediate: true } }, data() { return { + sysSelectData: [], + sysonymLoading: false, + synonymOption: { + addBtn: false, + editBtn: false, + delBtn: false, + refreshBtn: false, + columnBtn: false, + menu: false, + selection: true, + column: [ + { + label: '缂栫爜', + prop: 'id', + align: 'center' + }, + { + label: '鍚嶇О', + prop: 'name', + align: 'center' + }, + { + label: '婧愬��', + prop: 'sourceValue', + align: 'center' + }, + { + label: '鍚屼箟璇�', + prop: 'synonymValue', + align: 'center' + }, + { + label: '鍚仠鐘舵��', + prop: 'lcStatus', + align: 'center', + slot: true + }, + ] + }, + synonymData: [], + //杩戜箟璇嶆煡璇㈣鍒� + synonymVisible: false, + //琛ㄦ牸楂樺害 + dynamicHeight: '', + // 淇濆瓨鍗曞厓鏍肩姸鎬� + AddCellFlag: false, //鍏ㄥ睆缂栬緫楂樺害鐘舵�� - editStyleFlag:false, - loading:false, - referConfigText:"", - referConfigVisble:false, - referConfigOption:{ - referConfig:'', + editStyleFlag: false, + loading: false, + referConfigText: "", + referConfigVisble: false, + referConfigOption: { + referConfig: '', }, screenWidth: document.documentElement.clientWidth, // 灞忓箷瀹藉害 //褰撳墠鍗曞厓鏍� - CurrentCell:'', + CurrentCell: '', // 鏂板 - SelectValue:"", - SelectFInd:"", - SelectOption:[ + SelectValue: "", + SelectFInd: "", + SelectOption: [ { value: 'name', label: '灞炴�т腑鏂囧悕绉�' @@ -462,12 +612,12 @@ } ], //鍙傜収 - referVisible:false, - crudArrayFlag:false, + referVisible: false, + crudArrayFlag: false, editingRows: null, - editShows:"", + editShows: "", attrFlag: false, - referObject:{}, + referObject: {}, //缂栫爜鐢宠棰勮option applicationoption: { column: [] @@ -574,7 +724,7 @@ // 绾ц仈鍗曢�� selectRow: '', //绾ц仈鍗曢�夋暟缁� - selectRowArr:[], + selectRowArr: [], // 绾ц仈data CascadeData: [], // 绾ц仈option @@ -583,6 +733,7 @@ addBtn: false, header: false, align: 'center', + columnBtn: false, menuAlign: 'center', column: [{ label: '', @@ -725,7 +876,7 @@ }, { label: "鍙", - prop: "readonlyFlag", + prop: "readOnlyFlag", }, { label: "鍒楄〃鎺掑簭", @@ -797,6 +948,7 @@ { label: "鍙傜収閰嶇疆", prop: "referConfig", + width: 105 }, { label: "绾ц仈鏌ヨ灞炴��", @@ -841,7 +993,7 @@ { label: "鍙栧�艰寖鍥�", prop: "valueArea", - }, + } ] }, // 瀛樺偍琛ㄦ牸鏁版嵁 @@ -869,18 +1021,18 @@ addvisible: false, //鍒嗙被娉ㄥ叆option injectOption: { - classifyInvokeAttrName:'鍒嗙被鍚嶇О', + classifyInvokeAttrName: '鍒嗙被鍚嶇О', classifyInvokeAttr: "name", classifyInvokeEditFlag: "true", - classifyInvokeLevel:'min', + classifyInvokeLevel: 'min', //鍒嗙被娉ㄥ叆璁℃暟鍣� - classifyNumber:0, + classifyNumber: 0, }, // 灞炴�ч獙璇佽緭鍏ユ RulesForm: { expressionText: "", TestContent: "", - ruleRowBds:"" + ruleRowBds: "" }, //灞炴�ч獙璇佽鍒欓厤缃� rulesOption: { @@ -1023,6 +1175,10 @@ indexClassName: "搴忓彿", indexLabelClassName: '搴忓彿', index: true, + indexFixed: false, + selectionFixed: false, + columnBtn: false, + refreshBtn: false, border: true, addBtn: false, menu: false, @@ -1031,11 +1187,13 @@ column: [ { label: "灞炴�ц嫳鏂囧悕绉�", - prop: "id" + prop: "id", + width: 130, }, { label: "灞炴�т腑鏂囧悕绉�", - prop: "name" + prop: "name", + width: 100, }, { label: "闀垮害", @@ -1044,7 +1202,7 @@ { label: "鏁版嵁绫诲瀷", prop: "attrDataType", - formatter:function(row,column){ + formatter: function (row, column) { let vciFieldTypeMap = { VTBoolean: "甯冨皵鍨�", VTClob: "闀挎枃鏈�", @@ -1063,7 +1221,9 @@ { label: "鍙┖", prop: "nullableFlag", - formatter:function(row,column){return row.nullableFlag=='true' || row.nullableFlag=='1'?'鏄�':'鍚�'} + formatter: function (row, column) { + return row.nullableFlag == 'true' || row.nullableFlag == '1' ? '鏄�' : '鍚�' + } }, { label: "榛樿鍊�", @@ -1074,7 +1234,7 @@ prop: "precisionLength" }, { - label: "灏忕簿鍒诲害", + label: "灏忔暟鍒诲害", prop: "scaleLength" }, { @@ -1114,6 +1274,7 @@ List: [], option: { index: false, + columnBtn: false, border: true, editBtn: false, selection: true, @@ -1134,14 +1295,14 @@ width: 90, fixed: true }, { - label: "灞炴�ц嫳鏂囩紪鍙�", - prop: "id", - fixed: true, - cell: false, - labelWidth: 110, - width: 125, - sortable: false, - }, + label: "灞炴�ц嫳鏂囩紪鍙�", + prop: "id", + fixed: true, + cell: false, + labelWidth: 110, + width: 125, + sortable: false, + }, { label: "灞炴�т腑鏂囧悕绉�", prop: "name", @@ -1193,6 +1354,12 @@ edit: "switch" }, { + label: '杩戜箟璇嶆煡璇㈣鍒�', + prop: 'sysonymRuleOidsText', + cell: false, + edit: 'refer' + }, + { label: "鐩镐技鏌ラ噸灞炴��", prop: "sameRepeatAttrFlag", width: 110, @@ -1219,7 +1386,7 @@ }, { label: "鍙", - prop: "readonlyFlag", + prop: "readOnlyFlag", cell: false, edit: "switch" }, @@ -1231,7 +1398,7 @@ }, { label: "澶氳鏂囨湰", - prop: "textareaFlag", + prop: "textAreaFlag", cell: false, edit: "switch" }, @@ -1401,7 +1568,7 @@ ], List: [] }, - vciFieldTypeMap : { + vciFieldTypeMap: { VTBoolean: "甯冨皵鍨�", VTClob: "闀挎枃鏈�", VTDate: "鏃ユ湡", @@ -1414,9 +1581,9 @@ VTString: "瀛楃涓�" }, //鏃堕棿鏍煎紡涓嬫媺妗� - codeDataFlag:false, - // 缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~ - componentRuleText:"", + codeDataFlag: false, + // 缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~ + componentRuleText: "", //妯℃澘灞炴�т笅鎷夎缃畇witch selectoptions: [{ value: 'keyAttrFlag', @@ -1446,13 +1613,13 @@ value: 'tableDisplayFlag', label: '鍒楄〃鏄剧ず' }, { - value: 'readonlyFlag', + value: 'readOnlyFlag', label: '鍙' }, { value: 'sortAttrFlag', label: '鍒楄〃鎺掑簭' }, { - value: 'textareaFlag', + value: 'textAreaFlag', label: '澶氳鏂囨湰' }, { value: 'imageFlag', @@ -1460,10 +1627,29 @@ }], //妯℃澘灞炴�т笅鎷夐�変腑鍊� selectvalue: 'keyAttrFlag', - switchvalue:'false' + switchvalue: 'false' } }, - computed:{ + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + busineStatus: this.vaildData(this.btnAuthList.attr_add, false), + fullscreenStatus: this.vaildData(this.btnAuthList.attr_view_edit, false), + ruleStatus: this.vaildData(this.btnAuthList.attr_rule, false), + attrStatus: this.vaildData(this.btnAuthList.attr_group, false), + saveStatus: this.vaildData(this.btnAuthList.attr_save, false), + resetStatus: this.vaildData(this.btnAuthList.attr_reset, false), + injectStatus: this.vaildData(this.btnAuthList.attr_inject, false), + isShowStatus: this.vaildData(this.btnAuthList.attr_formrule, false), + enumStatus: this.vaildData(this.btnAuthList.attr_enum, false), + cascadStatus: this.vaildData(this.btnAuthList.attr_parentcode, false), + syncStatus: this.vaildData(this.btnAuthList.attr_sync, false), + applicationStatus: this.vaildData(this.btnAuthList.attr_application, false), + orderStatus: this.vaildData(this.btnAuthList.attr_sort, false), + removeStatus: this.vaildData(this.btnAuthList.attr_delete, false), + } + }, attrOids() { let oids = []; this.attrSelectList.forEach(ele => { @@ -1478,67 +1664,100 @@ }); return oids.join(","); }, + tableHeight() { + if (this.editStyleFlag) { + return '800px' + } else { + return 'calc(100vh - 602px)' + } + } }, mounted() { }, created() { - this.option.column.forEach((item,index) => { + this.option.column.forEach((item, index) => { if (item.edit == 'select') { - this.selectChangeHandler(item.editConfig,index) + this.selectChangeHandler(item.editConfig, index) } }) }, methods: { + //杩戜箟璇嶆煡璇㈣鍒欏彇娑� + sysnonymCancel() { + this.synonymVisible = false; + }, + //杩戜箟璇嶆煡璇㈣鍒欑‘瀹� + sysnonymSubmit() { + if (this.sysSelectData.length <= 0) { + this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒') + } else { + const newArray = this.sysSelectData.map(obj => obj.oid); + const newString = newArray.join(','); + const newArrayName = this.sysSelectData.map(obj => obj.name); + const newStringName = newArrayName.join(',') + this.$set(this.CurrentCell, 'sysonymRuleOids', newString) + //text + this.$set(this.CurrentCell, 'sysonymRuleOidsText', newStringName) + this.$set(this.CurrentCell, 'sysonymRuleOidsData', this.sysSelectData) + this.AddCellFlag = true; + this.synonymVisible = false; + } + }, + sysClear(){ + this.CurrentCell.sysonymRuleOidsText = ""; + this.CurrentCell.sysonymRuleOidsData = ""; + this.AddCellFlag = true; + }, + sysChange(row) { + this.sysSelectData = row; + }, //鏂板鎼滅储 - AddFindHandler(){ - if(this.SelectValue == 'id'){ - const masterParameter={ - 'conditionMap[id]':this.SelectFInd + AddFindHandler() { + if (this.SelectValue == 'id') { + const masterParameter = { + 'conditionMap[id]': this.SelectFInd } this.BuineAttrByBtm(masterParameter); - this.SelectValue="" - this.SelectFInd="" - }else if(this.SelectValue == 'name'){ - const masterParameter={ - 'conditionMap[name]':this.SelectFInd + this.SelectValue = "" + this.SelectFInd = "" + } else if (this.SelectValue == 'name') { + const masterParameter = { + 'conditionMap[name]': this.SelectFInd } this.BuineAttrByBtm(masterParameter) - this.SelectValue="" - this.SelectFInd="" + this.SelectValue = "" + this.SelectFInd = "" } }, //鍙傜収閰嶇疆瀛愮粍浠� - echoReferConfig(val){ - this.referObject=val - this.$set(this.CurrentCell,'referConfig',JSON.stringify(val)) + echoReferConfig(val) { + this.referObject = val + this.$set(this.CurrentCell, 'referConfig', JSON.stringify(val)) }, //鍙緭鍙�変笅鎷� - selectChangeHandler(editConfig,index){ - let that=this; - /*if(that.option.column[index].data && that.option.column[index].data.length>=0){ - return; - }*/ - listByFlag(editConfig.extraParams).then(res=>{ - that.option.column[index].data=res.data.data; + selectChangeHandler(editConfig, index) { + let that = this; + listByFlag(editConfig.extraParams).then(res => { + that.option.column[index].data = res.data.data; }) }, //灞炴�у垎缁勬寜閽� attrVisibleHandle() { - if (this.attrSelectList < 1) { + if (this.attrSelectList < 1) { this.$message.warning('璇烽�夋嫨妯℃澘灞炴��') - } else { + } else { this.attrVisible = true; } }, //灞炴�у垎缁勬彁浜� attrHandle() { - this.attrSelectList.forEach(item=>{ - item.attributeGroup=this.attrModel + this.attrSelectList.forEach(item => { + item.attributeGroup = this.attrModel }) - if(this.CurrentCell){ - this.$set(this.CurrentCell, 'attributeGroup', this.attrModel) - }else { + if (this.CurrentCell) { + this.$set(this.CurrentCell, 'attributeGroup', this.attrModel); + } else { this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel) } this.attrClose() @@ -1547,18 +1766,18 @@ attrRemove() { this.attrModel = "" }, - attrClose(){ + attrClose() { this.attrModel = ""; - this.attrVisible=false + this.attrVisible = false }, //琛ㄦ牸鏁版嵁 CrudRend() { if (this.crudOid != '') { - gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid,limit:-1}).then(res => { - this.loading=true + gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid, limit: -1}).then(res => { + this.loading = true setTimeout(() => { this.ProData = res.data.data; - this.loading=false + this.loading = false }, 1000); }).catch(res => { @@ -1583,7 +1802,7 @@ }) if (!isCopy) { citem.oid = '' - this.busineAddList=Object.assign(citem, { + this.busineAddList = Object.assign(citem, { orderNum: ++ordernum, attributeDataType: citem.attrDataType, attributeDataTypeText: this.vciFieldTypeMap[citem.attrDataType], @@ -1602,9 +1821,12 @@ queryAttrFlag: 'true', seniorQueryAttrFlag: 'true', attrTableWidth: 120, - ts:"" + ts: "" }) - this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) + // 灏嗚嫳鏂囩紪鍙疯浆鎹负灏忓啓 + let {id, ...res} = this.busineAddList; + this.busineAddList = {id: id.toLowerCase(), ...res}; + this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))); } }) this.addVisible = false; @@ -1618,11 +1840,14 @@ this.addVisible = true; this.busineSelectList = [] this.busineAddList = []; - this.BuineAttrByBtm() + this.BuineAttrByBtm(); + this.$nextTick(() => { + this.$refs.AddOriginPlace.doLayout(); + }) }, //涓氬姟绫诲瀷鏁版嵁 - BuineAttrByBtm(masterParameter){ - AttrByBtm({'conditionMap[oid]': this.crudOid,...masterParameter}).then(res => { + BuineAttrByBtm(masterParameter) { + AttrByBtm({'conditionMap[oid]': this.crudOid, ...masterParameter}).then(res => { this.businessData = res.data.data; }) }, @@ -1646,24 +1871,27 @@ CascadeAddHandle() { let CascadeString = ""; CascadeString = this.selectRowArr.id + (this.selectRowArr.name); - if(this.CurrentCell){ + if (this.CurrentCell) { this.$set(this.CurrentCell, 'parentCode', CascadeString) - }else { + } else { this.$set(this.attrSelectList[0], 'parentCode', CascadeString) } this.CascadeVisible = false; }, //绾ц仈灞炴�ф竻闄� casRemove() { - this.selectRow = "" + this.selectRow = ""; + this.$set(this.CurrentCell, 'parentCode', this.selectRow); + this.CascadeVisible = false; + }, // 绾ц仈灞炴�ц鍗曢�� CascaderowClick(row) { this.selectRow = row.$index; - this.selectRowArr=row + this.selectRowArr = row }, // 鎺掑簭棰勮鎸夐挳 - orderHandle(){ + orderHandle() { this.$refs.referAttrCrud.sort("orderNum"); }, //琛ㄦ牸鍗曢�� @@ -1675,7 +1903,7 @@ selectionChange(list) { this.attrSelectList = list; }, - rowClick(row){ + rowClick(row) { this.$refs.referAttrCrud.clearSelection(); this.attrSelectList = [row]; this.$refs.referAttrCrud.setCurrentRow(row); @@ -1686,79 +1914,159 @@ }, //淇濆瓨 addsHandler(event) { - batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { - this.$message.success('淇濆瓨鎴愬姛') - this.editOpenFlag=false; - // 璋冪敤鐖剁粍浠朵慨鏀规寜閽姸鎬� - this.$emit('editCloseChildren') - }).catch(()=>{ - this.$message.warning('淇濆瓨澶辫触锛岃鏌ョ湅鎺у埗鍙拌緭鍑猴紒') + this.$refs.referAttrCrud.sort("orderNum"); + var ischeck = true; + this.ProData.forEach((item, index) => { + if ((item.requireFlag && item.requireFlag.toString() == 'true') && (item.readOnlyFlag && item.readOnlyFlag.toString() == 'true')) { + this.$message.warning(item.name + "(" + item.id + ")蹇呰緭鐨勫睘鎬т笉鑳芥槸鍙"); + ischeck = false; + return; + } + var num = 0; + if (item.componentRule) { + //缁勫悎瑙勫垯 + num++ + } + if (item.enumString || item.enumId) { + //鏋氫妇 + num++ + } + if (item.referConfig || item.referBtmId) { + //鍙傜収 + num++ + } + if (item.codeDateFormat) { + //鏃堕棿鏍煎紡 + num++ + } + //濡傛灉绌哄悗鍙拌繑鍥瀗one + if (item.classifyInvokeLevel && item.classifyInvokeLevel != 'none') { + //鍒嗙被娉ㄥ叆 + num++ + } + if (num > 1 && ischeck) { + this.$message({ + showClose: true, + message: item.name + "(" + item.id + ") 灞炴�у彧鑳芥槸缁勫悎瑙勫垯锛屾灇涓撅紝鍙傜収锛屾椂闂存牸寮忥紝鍒嗙被娉ㄥ叆涓殑涓�绉�", + type: 'warning' + }); + ischeck = false; + return; + } }) + if (!ischeck) { + return; + } + // 鏂板嚱鏁扮敤浜庢墽琛宐atchAddSave鏂规硶 + const executeBatchAddSave = () => { + batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { + this.editOpenFlag = false; + this.$message.success('淇濆瓨鎴愬姛') + // 璋冪敤鐖剁粍浠朵慨鏀规寜閽姸鎬� + this.$emit('editCloseChildren') + this.AddCellFlag = true; + }).catch(() => { + this.$message.warning('淇濆瓨澶辫触锛岃鏌ョ湅鎺у埗鍙拌緭鍑猴紒') + }); + } + // 鎵�鏈塱f鏉′欢鍜岄�昏緫閫氳繃鍚庤皟鐢╡xecuteBatchAddSave鍑芥暟 + executeBatchAddSave(); }, //琛ㄦ牸琛岀紪杈� handleCellClicks(row, column) { - if(this.editOpenFlag){ - this.editingRows = row; - this.editShows = column.property; - this.rowOid = row.oid; - this.CurrentCell=row; - if(column.property == 'referConfig' ){ - this.referConfigVisble= true; - this.referConfigOption = { - referConfig: this.CurrentCell.referConfig || '', - } - if(this.CurrentCell.referConfig == ''){ - this.referConfigOption = { - referConfig:'', - } - } - // this.$refs.referConfigFormDialog.onloadAttrData(); - }else if(column.property == 'classifyInvokeText'){ - this.injectVisible=true; - if (this.CurrentCell.classifyInvokeAttr != '') { - this.injectOption = { - classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, - classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName, - classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag, - classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max', - classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel - }; - } else { - this.injectHandleReset(); - } - }else if(column.property == 'componentRule'){ - if(this.CurrentCell){ - this.CurrentCell.componentRule=this.componentRuleText; - } - this.isShowformulaEdit = true; - }else if(column.property == 'enumString'){ - this.enumVisible=true; - if(this.attrSelectList[0].enumString != ""){ - this.tableData=JSON.parse(this.attrSelectList[0].enumString) - return - } - }else if(column.property == 'parentCode'){ - gridCodeClassifyTemplateAttr({ - 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, - 'conditionMap[oid_notequal]': this.CurrentCell.oid, - limit:-1 - }).then(res => { - this.CascadeData = res.data.data; - }) - this.CascadeVisible=true; - }else if(column.property == 'verifyRule'){ - this.RulesForm.expressionTextt=this.CurrentCell.verifyRule; - this.rulesVisible=true; - }else if(column.property == 'attributeGroup'){ - this.attrVisible = true; - if(this.CurrentCell.attributeGroup !== ''){ - this.attrModel=this.CurrentCell.attributeGroup - } - } - } + if (this.editOpenFlag) { + this.AddCellFlag = false; + this.editingRows = row; + this.editShows = column.property; + this.rowOid = row.oid; + this.CurrentCell = row; + this.$nextTick(() => { + const inputs = this.$refs['input' + row.oid]; + const input = inputs && inputs.length > 0 ? inputs[0].$el : null; + if (input) { + input.focus(); + } + }); + const columnActions = { + referConfig: () => { + this.referConfigVisble = true; + this.referConfigOption = { + referConfig: this.CurrentCell.referConfig || '', + } + if (this.CurrentCell.referConfig == '') { + this.referConfigOption = { + referConfig: '', + } + } + }, + classifyInvokeText: () => { + this.injectVisible = true; + if (this.CurrentCell.classifyInvokeAttr != '') { + this.injectOption = { + classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, + classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName, + classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag, + classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max', + classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel + }; + } + }, + componentRule: () => { + this.isShowformulaEdit = true; + }, + enumString: () => { + this.enumVisible = true; + this.tableData = []; + if (this.CurrentCell.enumString != "") { + this.tableData = JSON.parse(this.CurrentCell.enumString) + return; + } + }, + parentCode: () => { + gridCodeClassifyTemplateAttr({ + 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, + 'conditionMap[oid_notequal]': this.CurrentCell.oid, + limit: -1 + }).then(res => { + this.CascadeData = res.data.data; + }) + this.CascadeVisible = true; + }, + verifyRule: () => { + this.RulesForm.expressionTextt = this.CurrentCell.verifyRule; + this.rulesVisible = true; + }, + attributeGroup: () => { + this.attrVisible = true; + if (this.CurrentCell.attributeGroup !== '') { + this.attrModel = this.CurrentCell.attributeGroup + } + }, + sysonymRuleOidsText: () => { + this.sysonymLoading = true + codeSynonym('1', '-1', 'Released').then(res => { + this.synonymData = res.data.data.records; + this.sysonymLoading = false; + }).catch(() => { + this.$message.error('璇锋鏌ユ帶鍒跺彴閿欒淇℃伅锛�') + }) + + this.synonymVisible = true; + } + }; + + if (column.property in columnActions) { + columnActions[column.property](); + } + } }, saveRows() { this.editingRows = null; + this.editShows = null; + // const inputElement = document.querySelector(`#inputRef${this.CurrentCell.oid}`); + // if (inputElement) { + // inputElement.blur(); + // } }, // 鏋氫妇娉ㄥ叆娣诲姞涓�琛岀┖鏁版嵁 addRow() { @@ -1777,27 +2085,27 @@ this.tableData.splice(row.$index, 1) }, //鏋氫妇娉ㄥ叆鎸夐挳 - enmuVisHandle() { + enumVisHandle() { if (this.attrSelectList.length > 1) { this.$message.warning('鍙兘閫夋嫨涓�鏉℃ā鏉垮睘鎬�') } else if (this.attrSelectList < 1) { this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬�') } else if (this.attrSelectList.length === 1) { this.enumVisible = true; - if(this.attrSelectList[0].enumString != ""){ - this.tableData=JSON.parse(this.attrSelectList[0].enumString) + if (this.attrSelectList[0].enumString != "") { + this.tableData = JSON.parse(this.attrSelectList[0].enumString) return } } }, - enumBeforeClose(done){ - this.tableData=[] + enumBeforeClose(done) { + this.tableData = [] done() }, - enumCancell(){ - this.tableData=[] - this.enumVisible=false; + enumCancell() { + this.tableData = [] + this.enumVisible = false; }, //鏋氫妇娉ㄥ叆澶氶�夋 handleSelectionChange(row) { @@ -1805,123 +2113,139 @@ }, //鏋氫妇娉ㄥ叆淇濆瓨 enumAddHandle() { - if(this.tableData.length>=1){ - let hasError = false; // 娣诲姞涓�涓彉閲� - this.tableData.forEach((item, index) => { - if (item.key === '') { - this.$message.warning(`绗�${index + 1}琛岀殑閫夐」鍊间笉鑳戒负绌篳); - hasError = true; - return; - } else if (item.value === '') { - this.$message.warning(`绗�${index + 1}琛岀殑閫夐」涓枃鏍囩涓嶈兘涓虹┖`); - hasError = true; - return; - } - }); - // 淇濆瓨鎵ц閫昏緫 - if (!hasError) { - if (this.CurrentCell) { - this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); - this.enumVisible = false; - } else { - this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); - this.tableData=[]; - this.enumVisible = false; - } - } - }else { - this.$message.warning('璇锋坊鍔犳灇涓炬敞鍏ユ暟鎹紒') - } + if (this.tableData.length >= 1) { + let hasError = false; // 娣诲姞涓�涓彉閲� + this.tableData.forEach((item, index) => { + if (item.key === '') { + this.$message.warning(`绗�${index + 1}琛岀殑閫夐」鍊间笉鑳戒负绌篳); + hasError = true; + return; + } else if (item.value === '') { + this.$message.warning(`绗�${index + 1}琛岀殑閫夐」涓枃鏍囩涓嶈兘涓虹┖`); + hasError = true; + return; + } + }); + // 淇濆瓨鎵ц閫昏緫 + if (!hasError) { + if (this.CurrentCell) { + this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); + this.enumVisible = false; + } else { + this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); + this.tableData = []; + this.enumVisible = false; + } + } + } else { + this.$message.warning('璇锋坊鍔犳灇涓炬敞鍏ユ暟鎹紒') + } }, // 灏嗘鍦ㄧ紪杈戠殑琛岀殑鐘舵�佸彉涓� null锛屽嵆閫�鍑虹紪杈戠姸鎬� saveRow() { this.editingRow = null; }, //楠岃瘉瑙勫垯鎸夐挳 - ruleAddHandler(){ + ruleAddHandler() { if (this.attrSelectList < 1) { this.$message.warning('璇烽�夋嫨妯℃澘灞炴��') - } else{ - this.rulesVisible=true + } else { + this.rulesVisible = true } }, //瑙勫垯鏍¢獙锛屽弻鍑昏〃鍗曚簨浠� handleRulesRowDBLClick(row) { - this.ruleRowBds=row.bds + this.ruleRowBds = row.bds this.RulesForm.expressionText = row.bds }, // 楠岃瘉瑙勫垯娓呴櫎鍐呭 rulesremove() { this.RulesForm.expressionText = "" this.RulesForm.TestContent = "" + this.$set(this.CurrentCell, 'verifyRule', '') + this.rulesVisible = false }, // 楠岃瘉瑙勫垯纭畾 rulesHandle() { - if(this.CurrentCell){ - this.$set(this.CurrentCell,'verifyRule',this.RulesForm.expressionText) - }else { - this.attrSelectList.forEach((item)=>{ - this.$set(item,'verifyRule',this.RulesForm.expressionText) - }) - this.rulesremove() - } + if (this.CurrentCell) { + this.$set(this.CurrentCell, 'verifyRule', this.RulesForm.expressionText) + this.AddCellFlag = !this.AddCellFlag; + } else { + this.attrSelectList.forEach((item) => { + this.$set(item, 'verifyRule', this.RulesForm.expressionText) + }) + this.rulesremove() + } this.rulesVisible = false }, //楠岃瘉瑙勫垯妫�鏌� rulesExamine() { const regex = new RegExp(this.rulesData.ruleRowBds); - if(regex.test(this.RulesForm.TestContent)){ + if (regex.test(this.RulesForm.TestContent)) { this.$message.success('鏍¢獙鎴愬姛') + } else { + this.$message.error('鏍¢獙澶辫触') } }, //鐐瑰嚮鍒嗙被娉ㄥ叆鎸夐挳 injectBtn() { if (this.attrSelectList.length > 1) { this.$message.warning('鍙兘閫夋嫨涓�鏉℃ā鏉挎暟鎹�') - } else if (this.attrSelectList.length < 1) { + return; + } + if (this.attrSelectList.length < 1) { this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉挎暟鎹�') - } else if (this.attrSelectList.length === 1) { + return; + ; + } + if (this.attrSelectList.length === 1) { this.injectVisible = true; + return; } }, //鍒嗙被娉ㄥ叆淇濆瓨 injectAddHandle() { - // 瀹氫箟灞曠ず绫诲瀷 - let data = { - "娉ㄥ叆绫诲瀷": this.injectOption.classifyInvokeAttr, - "娉ㄥ叆绫诲瀷鍚嶇О": this.injectOption.classifyInvokeAttrName, - "灞傜骇璁剧疆": this.injectOption.classifyInvokeLevel=='max'?this.injectOption.classifyNumber :'min', - "鏄惁鍙慨鏀�": this.injectOption.classifyInvokeEditFlag - } - //鍕鹃�夋搷浣� - for (const key in this.injectOption) { - this.attrSelectList[0][key] = this.injectOption[key]; - //濡傛灉鏄寚瀹氬眰璧嬪�间负鏁板瓧 - if(this.injectOption.classifyInvokeLevel !== 'min'){ - this.attrSelectList[0].classifyInvokeLevel=this.injectOption.classifyNumber - }else { - this.attrSelectList[0].classifyInvokeLevel='min' - } - this.$set(this.attrSelectList[0],'classifyInvokeText',data) + const { + classifyInvokeAttr, + classifyInvokeAttrName, + classifyInvokeLevel, + classifyInvokeEditFlag, + classifyNumber + } = this.injectOption; + + const data = { + "娉ㄥ叆绫诲瀷": classifyInvokeAttr, + "娉ㄥ叆绫诲瀷鍚嶇О": classifyInvokeAttrName, + "灞傜骇璁剧疆": classifyInvokeLevel === 'max' ? classifyNumber : 'min', + "鏄惁鍙慨鏀�": classifyInvokeEditFlag + }; + for (const key in this.injectOption) { + this.attrSelectList[0][key] = this.injectOption[key]; + if (classifyInvokeLevel !== 'min') { + this.attrSelectList[0].classifyInvokeLevel = classifyNumber; + } else { + this.attrSelectList[0].classifyInvokeLevel = 'min'; } - this.injectHandleReset() - - if(this.injectOption.classifyInvokeLevel !== 'min'){ - this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber; - }else { - this.injectOption.classifyNumber=0; + this.$set(this.attrSelectList[0], 'classifyInvokeText', data); } + if (classifyInvokeLevel !== 'min') { + this.injectOption.classifyInvokeLevel = classifyNumber; + } else { + this.injectOption.classifyNumber = 0; + } + // console.log(this.ProData) this.injectVisible = false; - }, //鍒嗙被娉ㄥ叆娓呯┖ injectHandleReset() { - this.injectOption.classifyInvokeAttrName = "鍒嗙被鍚嶇О"; - this.injectOption.classifyInvokeAttr = "name"; - this.injectOption.classifyInvokeLevel = "min"; - this.injectOption.classifyInvokeEditFlag = "true"; - this.injectOption.classifyNumber = "0"; + this.CurrentCell.classifyInvokeText = null; + this.CurrentCell.classifyInvokeAttr = ''; + this.CurrentCell.classifyInvokeAttrName = ''; + this.CurrentCell.classifyInvokeEditFlag = ''; + this.CurrentCell.classifyInvokeLevel = null; + // console.log(this.ProData) + this.injectVisible = false; }, // 鍒嗙被娉ㄥ叆鍙栨秷 injectRemove() { @@ -1935,13 +2259,13 @@ }, //琛ㄦ牸鍒犻櫎 CrudRemove() { - this.attrSelectList.forEach((item)=>{ + this.attrSelectList.forEach((item) => { const index = this.ProData.indexOf(item); this.ProData.splice(index, 1) }) }, //琛ㄦ牸閲嶇疆 - reset() { + resetHandler() { this.CrudRend() }, //鍚屾鍒板叾浠栨ā鏉� @@ -1967,7 +2291,7 @@ } else if (this.attrSelectList.length < 1) { this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬ф暟鎹�') } else if (this.attrSelectList.length === 1) { - this.isShowformulaEdit=true + this.isShowformulaEdit = true } }, //鍏ㄥ睆缂栬緫 @@ -1975,9 +2299,10 @@ if (this.crudArray.length < 1) { this.$message.warning('璇烽�夋嫨涓�涓ā鏉�') } else { - this.editStyleFlag=true; + this.editStyleFlag = true; this.attrEditVisible = true; this.attrFlag = true; + this.AddCellFlag = true; } }, @@ -1985,54 +2310,89 @@ escEdit() { this.attrFlagChiledren = false; this.attrEditVisible = false; - this.editStyleFlag=false; + this.editStyleFlag = false; }, //缁勫悎瑙勫垯纭畾 updataFormlaContent(val) { - if(this.CurrentCell){ + if (this.CurrentCell) { this.$set(this.CurrentCell, 'componentRule', val.replace(/"/g, '')) - }else { + this.componentRuleText = this.CurrentCell.componentRule + } else { this.$set(this.attrRow, 'componentRule', val.replace(/"/g, '')) } }, - setReferConfigValue(content){ + setReferConfigValue(content) { let submitFormJson = JSON.stringify(content); - this.referConfigText=submitFormJson - if(this.CurrentCell){ + this.referConfigText = submitFormJson + if (this.CurrentCell) { this.$set(this.CurrentCell, 'referConfig', JSON.stringify(content)) - }else { + } else { this.$set(this.attrRow, 'referConfig', JSON.stringify(content)) } }, - // 鎺掑簭 + // 鎺掑簭 this.AddCellFlag=false; sortChange(val) { - console.log(val) + // console.log(val) }, //寮�鍚紪杈� - editOpen(){ - this.editOpenFlag=true; + editOpen() { + this.editOpenFlag = true; + this.AddCellFlag = false; }, //瀹氫箟涓�涓叧闂紪杈戠殑鏂规硶渚涘瓙缁勪欢浣跨敤 - editClose(){ - this.editOpenFlag=false; + editClose() { + this.editOpenFlag = false; }, //鎵归噺璁剧疆switch - batchSetFlag(value){ - this.attrSelectList.forEach(item=>{ - item[this.selectvalue]=value; + batchSetFlag(value) { + this.attrSelectList.forEach(item => { + item[this.selectvalue] = value; }) } } } </script> -<style scoped lang="scss" > -.app { - /deep/ .el-button { - //margin: 0 10px 10px 0; - } +<style lang="scss" scoped> + +/deep/ .el-table__fixed-body-wrapper { + .el-table__body { + padding-bottom: 15px; + } } + +//鍥哄畾鍒楅珮搴� +/deep/ .el-table__fixed { + height: calc(100vh - 618px) !important; +} + +///deep/ .el-table__fixed[v-if='editStyleFlag'] { +// height: calc(100vh - 152px)!important; // 缂栬緫鐘舵�佷笅鐨勯珮搴� +//} +// 婊氬姩鏉℃牱寮忎慨鏀� +// 婊氬姩鏉$殑瀹藉害 +/deep/ .el-table__body-wrapper::-webkit-scrollbar { + height: 15px; // 绾靛悜婊氬姩鏉� 蹇呭啓 + background: white; + border: white; + width: 10px; + +} + +// 婊氬姩鏉$殑婊戝潡 +/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { + background-color: #ececec; + border-radius: 20px; + border: #ececec; +} + +.app { + /deep/ .el-button { + //margin: 0 10px 10px 0; + } +} + .el-button-group { margin-right: 10px; margin-bottom: 10px; -- Gitblit v1.9.3