From 9b51b2a07769ee049937e16dd45d8c36c87dcc3c Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 08 十二月 2023 17:13:01 +0800
Subject: [PATCH] 主数据 枚举配置模板配置 参照配置表格显示问题处理
---
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 1124 ++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 731 insertions(+), 393 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
index cd1c2d8..e874bdf 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,54 +1,115 @@
<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>
+ <div v-if="this.crudArrayFlag" class="app" style="display: flex;flex-wrap: wrap; display: inline-block">
<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>
- <!-- 棰勮鎺掑簭-->
- <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
- <!--鏂板-->
- <!-- 淇濆瓨-->
- <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" @click="addsHandler" icon="el-icon-check">淇濆瓨</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>
+ <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>
- <!-- 鍚屾鍒板叾浠栨ā鏉�-->
- <el-button size="small"@click="syncHandle" icon="el-icon-share">鍚屾鍒板叾浠栨ā鏉�</el-button>
+ <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" icon="el-icon-view" @click="applicationHandle" style="">缂栫爜鐢宠棰勮</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 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" @click="editOpen" >寮�鍚紪杈�</el-button>
- </el-button-group>
+ <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
@@ -75,9 +136,15 @@
</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
+ :closable="false"
+ style="margin-bottom: 10px;display: inline-block"
+ title="璇锋柊澧炲悗鐐瑰嚮鍗曞厓鏍艰緭鍏ユ灇涓炬暟鎹�"
+ type="success">
+ </el-alert>
<div>
<el-button icon="el-icon-plus" type="primary" @click="addRow">鏂板</el-button>
<el-table :data="tableData" style="width: 100%" @cell-click="handleCellClick"
@@ -100,7 +167,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>
@@ -135,7 +202,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>
@@ -155,11 +223,12 @@
</div>
</el-dialog>
<!-- 灞炴�у垎缁�-->
- <el-dialog :visible.sync="attrVisible" append-to-body 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="灞炴�у垎缁�">
- <el-input v-model="attrModel"></el-input>
+ <el-input v-model="attrModel" autofocus></el-input>
</el-form-item>
<div style="display: flex;justify-content: flex-end">
<el-button size="small" type="primary" @click="attrHandle">鎻愪氦</el-button>
@@ -206,19 +275,22 @@
</el-container>
</el-dialog>
<!-- 鍏ㄥ睆缂栬緫-->
- <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true">
- <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
+ <el-dialog :before-close="escEdit" :visible.sync="attrEditVisible" append-to-body fullscreen="true">
+ <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :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;">
@@ -230,7 +302,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>
@@ -240,81 +312,99 @@
<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>
</div>
- <el-table :data="ProData"
- style="width: 100%"
- height="400"
- @cell-click="handleCellClicks"
- @select="selectHandle"
- @selection-change="selectionChange"
- v-if="this.crudArrayFlag"
- ref="referAttrCrud"
- v-loading="loading"
- >
- <el-table-column
- type="selection"
- width="55" fixed>
- </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"
- :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"
- align="center"
- v-if="item.edit !='referName'"
+
+ <el-table v-if="this.crudArrayFlag"
+ ref="referAttrCrud"
+ v-loading="loading"
+ :data="ProData"
+ :height="this.tableHeight"
+ :header-cell-style="{background:'#FAFAFA',color:'#505050'}"
+ border
+ style="width: 100%"
+ @select="selectHandle"
+ @cell-click="handleCellClicks"
+ @selection-change="selectionChange"
+ @row-click="rowClick"
>
- <template slot-scope="{ row }">
- <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]"
- @blur="saveRows" ></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-option
- v-for="optionItem in item.data"
- :key="optionItem.dictValue"
- :label="optionItem.dictValue"
- :value="optionItem.dictValue">
- </el-option>
- </el-select>
- <el-switch
- v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" :disabled="!editOpenFlag"
- inactive-value="false">
- </el-switch>
- <span v-else>{{ row[item.prop] }}</span>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- label="鎿嶄綔"
- width="70">
- <template slot-scope="scope">
- <el-button
- size="small"
- type="text"
- @click.native.prevent="CrudRowDel(scope.$index)">
- 绉婚櫎
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
+ <el-table-column
+ :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" v-if="item.edit !='referName'"
+ :key="item.id"
+ :fixed="!editStyleFlag ? item.fixed : undefined"
+ :formatter="formAttr"
+ :label="item.label"
+ :prop="item.prop"
+ :show-overflow-tooltip="true"
+ :sortable="item.sortable"
+ :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')"
+ align="center"
+ >
+ <template slot-scope="{ row }">
+ <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' " slot="prepend" :clearable="true"
+ v-model="row[item.prop]" allow-create default-first-option
+ filterable v-show="!AddCellFlag"
+ @blur="selectChangeHandler(item.editConfig,index)">
+ <el-option
+ v-for="optionItem in item.data"
+ :key="optionItem.dictValue"
+ :label="optionItem.dictValue"
+ :value="optionItem.dictValue">
+ </el-option>
+ </el-select>
+ <el-switch
+ 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>
+ </template>
+ </el-table-column>
+ <el-table-column
+ fixed="right"
+ label="鎿嶄綔"
+ width="70">
+ <template slot-scope="scope">
+ <el-button
+ size="small"
+ type="text"
+ @click.native.prevent="CrudRowDel(scope.$index)">
+ 绉婚櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
</template>
<script>
-import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr'
+import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto, listByFlag} 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",
@@ -326,11 +416,16 @@
type: String,
default: ''
},
- checkStatus:{
+ checkStatus: {
type: Boolean,
default: false
},
- editOpenFlag:{
+ //鎺у埗鏄惁寮�鍚紪杈�
+ editOpenFlag: {
+ type: Boolean,
+ default: false
+ },
+ editStyleFlag: {
type: Boolean,
default: false
},
@@ -352,58 +447,93 @@
type: Boolean,
default: false
},
- crudArrayFlag:{
+ crudArrayFlag: {
type: Boolean,
default: false
- }
+ },
},
- watch:{
- crudArray:{
- handler(newval,oldval){
- if(newval != undefined){
- if(newval.length>=1){
- this.crudArrayFlag=true
- }else{
- this.crudArrayFlag=false
+ watch: {
+ crudOid: {
+ handler(newval, oldval) {
+ if (newval) {
+ this.editOpenFlag = 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
},
- 'injectOption.classifyInvokeAttr': function(newVal) {
- console.log('newVal',newVal)
+ Formlist: {
+ handler(newval, oldval) {
+ if (newval.length === 0) {
+ this.crudArrayFlag = false
+ return
+ }
+ }
+ },
+ ProData: {
+ handler(newval, oldval) {
+ if (newval) {
+ this.loading = true;
+ setTimeout(() => {
+ this.loading = false
+ }, 1000);
+ }
+ }
+ },
+ '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(newval)
+ editOpenFlag: {
+ handler(newval, oldval) {
+ // console.log('editOpenFlag', newval)
},
- deep:true,
- immediate:true
+ deep: true,
+ immediate: true
}
},
data() {
return {
- loading:false,
- referConfigText:"",
- referConfigVisble:false,
- referConfigOption:{
- referConfig:'',
+ //琛ㄦ牸楂樺害
+ dynamicHeight: '',
+ // 淇濆瓨鍗曞厓鏍肩姸鎬�
+ AddCellFlag: false,
+ //鍏ㄥ睆缂栬緫楂樺害鐘舵��
+ editStyleFlag: false,
+ loading: false,
+ referConfigText: "",
+ referConfigVisble: false,
+ referConfigOption: {
+ referConfig: '',
},
screenWidth: document.documentElement.clientWidth, // 灞忓箷瀹藉害
//褰撳墠鍗曞厓鏍�
- CurrentCell:'',
+ CurrentCell: '',
// 鏂板
- SelectValue:"",
- SelectFInd:"",
- SelectOption:[
+ SelectValue: "",
+ SelectFInd: "",
+ SelectOption: [
{
value: 'name',
label: '灞炴�т腑鏂囧悕绉�'
@@ -414,12 +544,12 @@
}
],
//鍙傜収
- referVisible:false,
- crudArrayFlag:false,
+ referVisible: false,
+ crudArrayFlag: false,
editingRows: null,
- editShows:"",
+ editShows: "",
attrFlag: false,
- referObject:{},
+ referObject: {},
//缂栫爜鐢宠棰勮option
applicationoption: {
column: []
@@ -488,7 +618,7 @@
desc: "褰撳墠鐢ㄦ埛鐨勫鍚�"
},
{
- formula: "#CURRENTUSER.SECRETGRADE#",
+ formula: "#CURRENTUSER.SECRETARIAT#",
desc: "褰撳墠鐢ㄦ埛瀵嗙骇"
},
{
@@ -526,7 +656,7 @@
// 绾ц仈鍗曢��
selectRow: '',
//绾ц仈鍗曢�夋暟缁�
- selectRowArr:[],
+ selectRowArr: [],
// 绾ц仈data
CascadeData: [],
// 绾ц仈option
@@ -535,6 +665,7 @@
addBtn: false,
header: false,
align: 'center',
+ columnBtn: false,
menuAlign: 'center',
column: [{
label: '',
@@ -749,6 +880,7 @@
{
label: "鍙傜収閰嶇疆",
prop: "referConfig",
+ width: 105
},
{
label: "绾ц仈鏌ヨ灞炴��",
@@ -793,7 +925,7 @@
{
label: "鍙栧�艰寖鍥�",
prop: "valueArea",
- },
+ }
]
},
// 瀛樺偍琛ㄦ牸鏁版嵁
@@ -821,18 +953,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: {
@@ -975,6 +1107,8 @@
indexClassName: "搴忓彿",
indexLabelClassName: '搴忓彿',
index: true,
+ indexFixed:false,
+ selectionFixed:false,
border: true,
addBtn: false,
menu: false,
@@ -983,11 +1117,13 @@
column: [
{
label: "灞炴�ц嫳鏂囧悕绉�",
- prop: "id"
+ prop: "id",
+ width: 130,
},
{
label: "灞炴�т腑鏂囧悕绉�",
- prop: "name"
+ prop: "name",
+ width: 100,
},
{
label: "闀垮害",
@@ -996,7 +1132,7 @@
{
label: "鏁版嵁绫诲瀷",
prop: "attrDataType",
- formatter:function(row,column){
+ formatter: function (row, column) {
let vciFieldTypeMap = {
VTBoolean: "甯冨皵鍨�",
VTClob: "闀挎枃鏈�",
@@ -1015,7 +1151,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: "榛樿鍊�",
@@ -1026,7 +1164,7 @@
prop: "precisionLength"
},
{
- label: "灏忕簿鍒诲害",
+ label: "灏忔暟鍒诲害",
prop: "scaleLength"
},
{
@@ -1066,6 +1204,7 @@
List: [],
option: {
index: false,
+ columnBtn: false,
border: true,
editBtn: false,
selection: true,
@@ -1086,14 +1225,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",
@@ -1353,7 +1492,7 @@
],
List: []
},
- vciFieldTypeMap : {
+ vciFieldTypeMap: {
VTBoolean: "甯冨皵鍨�",
VTClob: "闀挎枃鏈�",
VTDate: "鏃ユ湡",
@@ -1366,13 +1505,75 @@
VTString: "瀛楃涓�"
},
//鏃堕棿鏍煎紡涓嬫媺妗�
- codeDataFlag:false,
- // 缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~
- componentRuleText:"",
-
+ codeDataFlag: false,
+ // 缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~
+ componentRuleText: "",
+ //妯℃澘灞炴�т笅鎷夎缃畇witch
+ selectoptions: [{
+ value: 'keyAttrFlag',
+ label: '鍏抽敭灞炴��'
+ }, {
+ value: 'queryAttrFlag',
+ label: '鏌ヨ灞炴��'
+ }, {
+ value: 'seniorQueryAttrFlag',
+ label: '楂樼骇鏌ヨ灞炴��'
+ }, {
+ value: 'sameRepeatAttrFlag',
+ label: '鐩镐技鏌ラ噸灞炴��'
+ }, {
+ value: 'barcodeFlag',
+ label: '涓�缁寸爜'
+ }, {
+ value: 'qrcodeFlag',
+ label: '浜岀淮鐮�'
+ }, {
+ value: 'requireFlag',
+ label: '蹇呰緭'
+ }, {
+ value: 'formDisplayFlag',
+ label: '琛ㄥ崟鏄剧ず'
+ }, {
+ value: 'tableDisplayFlag',
+ label: '鍒楄〃鏄剧ず'
+ }, {
+ value: 'readonlyFlag',
+ label: '鍙'
+ }, {
+ value: 'sortAttrFlag',
+ label: '鍒楄〃鎺掑簭'
+ }, {
+ value: 'textareaFlag',
+ label: '澶氳鏂囨湰'
+ }, {
+ value: 'imageFlag',
+ label: '棰勮鍥�'
+ }],
+ //妯℃澘灞炴�т笅鎷夐�変腑鍊�
+ selectvalue: 'keyAttrFlag',
+ switchvalue: 'false'
}
},
- computed:{
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ busineStatus: this.vaildData(this.permission.classifyTree.attr_add, false),
+ fullscreenStatus: this.vaildData(this.permission.classifyTree.attr_view_edit, false),
+ ruleStatus: this.vaildData(this.permission.classifyTree.attr_rule, false),
+ attrStatus: this.vaildData(this.permission.classifyTree.attr_group, false),
+ saveStatus: this.vaildData(this.permission.classifyTree.attr_save, false),
+ resetStatus: this.vaildData(this.permission.classifyTree.attr_reset, false),
+ injectStatus: this.vaildData(this.permission.classifyTree.attr_inject, false),
+ isShowStatus: this.vaildData(this.permission.classifyTree.attr_formrule, false),
+ enumStatus: this.vaildData(this.permission.classifyTree.attr_enum, false),
+ cascadStatus: this.vaildData(this.permission.classifyTree.attr_parentcode, false),
+ syncStatus: this.vaildData(this.permission.classifyTree.attr_sync, false),
+ applicationStatus: this.vaildData(this.permission.classifyTree.attr_application, false),
+ orderStatus: this.vaildData(this.permission.classifyTree.attr_sort, false),
+ removeStatus: this.vaildData(this.permission.classifyTree.attr_delete, false),
+ }
+ },
attrOids() {
let oids = [];
this.attrSelectList.forEach(ele => {
@@ -1387,87 +1588,91 @@
});
return oids.join(",");
},
+ tableHeight() {
+ if (this.editStyleFlag) {
+ return '800px'
+ } else {
+ return 'calc(100vh - 595px)'
+ }
+ }
},
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: {
- formAttr(row, column) {
- console.log(row,column)
- },
//鏂板鎼滅储
- 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){
- console.log('val--',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;
- console.log(this.attrSelectList)
}
},
//灞炴�у垎缁勬彁浜�
attrHandle() {
- console.log(this.attrSelectList)
- // this.$set(this.attrRow, 'attributeGroup', this.attrModel)
- // this.attrSelectList.attributeGroup=this.attrModel
- this.attrSelectList.forEach(item=>{
- item.attributeGroup=this.attrModel
+ this.attrSelectList.forEach(item => {
+ item.attributeGroup = this.attrModel
})
- this.attrModel = "";
- this.attrVisible = false;
+ if (this.CurrentCell) {
+ this.$set(this.CurrentCell, 'attributeGroup', this.attrModel);
+ } else {
+ this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel)
+ }
+ this.attrClose()
},
//灞炴�у垎缁勬竻绌�
attrRemove() {
this.attrModel = ""
},
+ attrClose() {
+ this.attrModel = "";
+ this.attrVisible = false
+ },
//琛ㄦ牸鏁版嵁
CrudRend() {
if (this.crudOid != '') {
- gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid}).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 => {
@@ -1492,7 +1697,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],
@@ -1511,29 +1716,33 @@
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;
-
},
//涓氬姟绫诲瀷閫夋嫨
businessSelect(selection, row) {
this.busineSelectList = selection;
- console.log(selection)
},
// 浠庝笟鍔$被鍨嬩腑閫夋嫨鏁版嵁寮圭獥
busineHandle() {
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;
})
},
@@ -1557,95 +1766,190 @@
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");
},
//琛ㄦ牸鍗曢��
selectHandle(selection, row) {
this.attrOid = row.oid;
this.attrRow = row;
- console.log(row)
},
//琛ㄦ牸閫夋嫨
selectionChange(list) {
this.attrSelectList = list;
- console.log(list)
+ },
+ rowClick(row) {
+ this.$refs.referAttrCrud.clearSelection();
+ this.attrSelectList = [row];
+ this.$refs.referAttrCrud.setCurrentRow(row);
+ this.$refs.referAttrCrud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+
+ this.attrOid = row.oid;
+ this.attrRow = row;
},
//淇濆瓨
- addsHandler() {
- batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => {
- this.$message.success('淇濆瓨鎴愬姛')
+ addsHandler(event) {
+ 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.referConfigText || '',
- }
- if(this.CurrentCell.referConfig == ''){
- this.referConfigOption = {
- referConfig:'',
- }
- }
- console.log('--',this.referConfigOption)
- // this.$refs.referConfigFormDialog.onloadAttrData();
- }else if(column.property == 'classifyInvokeText'){
- this.injectVisible=true;
- }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
- }).then(res => {
- console.log(res)
- this.CascadeData = res.data.data;
- })
- this.CascadeVisible=true;
- }else if(column.property == 'verifyRule'){
- this.RulesForm.expressionTextt=this.CurrentCell.verifyRule;
- this.rulesVisible=true;
- console.log(this.CurrentCell.verifyRule)
- console.log(this.RulesForm.expressionText)
- }
- }
+ if (this.editOpenFlag) {
+ 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
+ }
+ }
+ };
+
+ 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() {
@@ -1664,27 +1968,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) {
@@ -1692,28 +1996,32 @@
},
//鏋氫妇娉ㄥ叆淇濆瓨
enumAddHandle() {
- 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 (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;
+ 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锛屽嵆閫�鍑虹紪杈戠姸鎬�
@@ -1721,41 +2029,43 @@
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() {
- console.log(this.RulesForm.expressionText)
const regex = new RegExp(this.rulesData.ruleRowBds);
- if(regex.test(this.RulesForm.TestContent)){
+ if (regex.test(this.RulesForm.TestContent)) {
this.$message.success('鏍¢獙鎴愬姛')
}
},
@@ -1771,62 +2081,51 @@
},
//鍒嗙被娉ㄥ叆淇濆瓨
injectAddHandle() {
- // 瀹氫箟灞曠ず绫诲瀷
- let data = {
- "娉ㄥ叆绫诲瀷": this.injectOption.classifyInvokeAttr,
- "娉ㄥ叆绫诲瀷鍚嶇О": this.injectOption.classifyInvokeAttrName,
- "灞傜骇璁剧疆": this.injectOption.classifyInvokeLevel=='max'?this.injectOption.classifyNumber :'min',
- "鏄惁鍙慨鏀�": this.injectOption.classifyInvokeEditFlag
- }
- //鍗曞厓鏍肩紪杈戣祴鍊间竴閬�
- // noinspection JSCheckFunctionSignatures
- if(this.CurrentCell){
- //濡傛灉鏄寚瀹氬眰璧嬪�间负鏁板瓧
- if(this.injectOption.classifyInvokeLevel!== 'min'){
- this.CurrentCell.classifyInvokeLevel=this.injectOption.classifyNumber
- }else {
- this.CurrentCell.classifyInvokeLevel='min'
- }
- //鍏朵綑姝e父璧嬪��
- this.CurrentCell.classifyInvokeAttr=this.injectOption.classifyInvokeAttr,
- this.CurrentCell.classifyInvokeAttrName=this.injectOption.classifyInvokeAttrName,
- this.CurrentCell.classifyInvokeEditFlag=this.injectOption.classifyInvokeEditFlag,
- // this.$set(this.CurrentCell, 'classifyInvokeText', data)
- this.CurrentCell.classifyInvokeText = data;
- this.injectHandleReset()
- }else {
- //鍕鹃�夋搷浣�
- 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)
- }
- this.injectHandleReset()
- }
- if(this.injectOption.classifyInvokeLevel !== 'min'){
- this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber;
- }else {
- this.injectOption.classifyNumber=0;
- }
- this.injectVisible = false;
+ 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.$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() {
- this.injectVisible = false
+ this.injectVisible = false;
+ this.injectHandleReset()
},
//灞炴�фā鏉胯〃鏍煎崟鍏冩牸鐐瑰嚮浜嬩欢
//琛ㄦ牸鎿嶄綔鏍忓垹闄�
@@ -1835,13 +2134,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()
},
//鍚屾鍒板叾浠栨ā鏉�
@@ -1867,7 +2166,7 @@
} else if (this.attrSelectList.length < 1) {
this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬ф暟鎹�')
} else if (this.attrSelectList.length === 1) {
- this.isShowformulaEdit=true
+ this.isShowformulaEdit = true
}
},
//鍏ㄥ睆缂栬緫
@@ -1875,8 +2174,10 @@
if (this.crudArray.length < 1) {
this.$message.warning('璇烽�夋嫨涓�涓ā鏉�')
} else {
+ this.editStyleFlag = true;
this.attrEditVisible = true;
this.attrFlag = true;
+ this.AddCellFlag = true;
}
},
@@ -1884,45 +2185,82 @@
escEdit() {
this.attrFlagChiledren = false;
this.attrEditVisible = 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;
- console.log('涓嶇瓑浜�',this.checkStatus)
- console.log('绛変簬',this.editOpenFlag)
- console.log('绛変簬',this.crudLCStatus)
+ //寮�鍚紪杈�
+ editOpen() {
+ this.editOpenFlag = true;
+ this.AddCellFlag = false;
+ },
+ //瀹氫箟涓�涓叧闂紪杈戠殑鏂规硶渚涘瓙缁勪欢浣跨敤
+ editClose() {
+ this.editOpenFlag = false;
+ },
+ //鎵归噺璁剧疆switch
+ 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 {
+ height: calc(100vh - 612px) !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