From 1f6c005d4446b0bdf40d1680c385e43bd53d963d Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 25 八月 2023 11:04:28 +0800
Subject: [PATCH] 主数据 码段展示(层级码段)
---
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 856 +++++++++++++++++++++++++++++++++-----------------------
1 files changed, 498 insertions(+), 358 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
index 3f35190..5be48b7 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,65 +1,91 @@
<template>
<div>
- <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app">
-
+ <div v-if="this.crudArrayFlag" class="app" style="display: flex;flex-wrap: wrap; display: inline-block">
<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
+ v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )"
+ icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle">娣诲姞 {{ msg }}
+ </el-button>
+ <!-- 鍏ㄥ睆缂栬緫-->
+ <el-button
+ v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')"
+ icon="el-icon-full-screen" size="small" @click="fullscreenHandle">鍏ㄥ睆缂栬緫
+ </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="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
+ <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain size="small"
+ type="success" @click.prevent="addsHandler">淇濆瓨
+ </el-button>
<!-- 棰勮鎺掑簭-->
- <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
+ <el-button icon="el-icon-arrow-down" size="small" @click="orderHandle">棰勮鎺掑簭</el-button>
<!-- 鍒犻櫎-->
- <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">鍒犻櫎</el-button>
+ <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-delete" size="small"
+ @click="CrudRemove">鍒犻櫎
+ </el-button>
<!-- 閲嶇疆-->
- <el-button size="small" @click="reset" icon="el-icon-refresh-right">閲嶇疆</el-button>
+ <el-button icon="el-icon-refresh-right" size="small" @click="reset">閲嶇疆</el-button>
</el-button-group>
<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-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>
+ <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>
</el-button-group>
<el-button-group>
- <!-- 鍚屾鍒板叾浠栨ā鏉�-->
- <el-button size="small"@click="syncHandle" icon="el-icon-share">鍚屾鍒板叾浠栨ā鏉�</el-button>
+ <!-- 鍚屾鍒板叾浠栨ā鏉�-->
+ <el-button 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 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
@@ -86,9 +112,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"
@@ -111,7 +143,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>
@@ -146,7 +178,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>
@@ -166,11 +199,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>
@@ -217,19 +251,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" :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" :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;">
@@ -241,7 +278,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>
@@ -253,46 +290,54 @@
</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="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"
+ :height="this.editStyleFlag? 800 : 343"
+ style="width: 100%"
+ @select="selectHandle"
+ @cell-click="handleCellClicks"
+ @selection-change="selectionChange"
+ @row-click="rowClick"
>
<el-table-column
- type="selection"
- width="55" fixed>
+ fixed
+ 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="item.fixed"
+ :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' )"
+ :ref="'input' + row.oid"
+ v-show="!AddCellFlag"
+ v-model="row[item.prop]"
+ @blur="saveRows(row)"
+ ></el-input>
+ <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" 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" v-model="row[item.prop]" allow-create default-first-option
+ filterable
+ @blur="selectChangeHandler(item.editConfig,index)">
<el-option
v-for="optionItem in item.data"
:key="optionItem.dictValue"
@@ -301,7 +346,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>
@@ -325,8 +370,10 @@
</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";
export default {
name: "attrCrud .vue",
@@ -338,16 +385,16 @@
type: String,
default: ''
},
- checkStatus:{
+ checkStatus: {
type: Boolean,
default: false
},
//鎺у埗鏄惁寮�鍚紪杈�
- editOpenFlag:{
+ editOpenFlag: {
type: Boolean,
default: false
},
- editStyleFlag:{
+ editStyleFlag: {
type: Boolean,
default: false
},
@@ -369,85 +416,101 @@
type: Boolean,
default: false
},
- crudArrayFlag:{
+ crudArrayFlag: {
type: Boolean,
default: false
},
},
- 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;
+ // editingRows:{
+ // handler(newval,oldval){
+ // if(newval){
+ // const inputElement = document.querySelector(`#inputRef${newval.oid}`);
+ // if (inputElement) {
+ // inputElement.focus();
+ // };
+ // }
+ // }
+ // },
+ ProData: {
+ handler(newval, oldval) {
+ if (newval) {
+ this.loading = true;
setTimeout(() => {
- this.loading=false
+ this.loading = false
}, 1000);
}
}
},
- 'injectOption.classifyInvokeAttr': function(newVal) {
- console.log('newVal',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 {
+ // 淇濆瓨鍗曞厓鏍肩姸鎬�
+ 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: '灞炴�т腑鏂囧悕绉�'
@@ -458,12 +521,12 @@
}
],
//鍙傜収
- referVisible:false,
- crudArrayFlag:false,
+ referVisible: false,
+ crudArrayFlag: false,
editingRows: null,
- editShows:"",
+ editShows: "",
attrFlag: false,
- referObject:{},
+ referObject: {},
//缂栫爜鐢宠棰勮option
applicationoption: {
column: []
@@ -570,7 +633,7 @@
// 绾ц仈鍗曢��
selectRow: '',
//绾ц仈鍗曢�夋暟缁�
- selectRowArr:[],
+ selectRowArr: [],
// 绾ц仈data
CascadeData: [],
// 绾ц仈option
@@ -865,18 +928,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: {
@@ -1027,11 +1090,13 @@
column: [
{
label: "灞炴�ц嫳鏂囧悕绉�",
- prop: "id"
+ prop: "id",
+ width:100,
},
{
label: "灞炴�т腑鏂囧悕绉�",
- prop: "name"
+ prop: "name",
+ width:100,
},
{
label: "闀垮害",
@@ -1040,7 +1105,7 @@
{
label: "鏁版嵁绫诲瀷",
prop: "attrDataType",
- formatter:function(row,column){
+ formatter: function (row, column) {
let vciFieldTypeMap = {
VTBoolean: "甯冨皵鍨�",
VTClob: "闀挎枃鏈�",
@@ -1059,7 +1124,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: "榛樿鍊�",
@@ -1070,7 +1137,7 @@
prop: "precisionLength"
},
{
- label: "灏忕簿鍒诲害",
+ label: "灏忔暟鍒诲害",
prop: "scaleLength"
},
{
@@ -1130,14 +1197,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",
@@ -1397,7 +1464,7 @@
],
List: []
},
- vciFieldTypeMap : {
+ vciFieldTypeMap: {
VTBoolean: "甯冨皵鍨�",
VTClob: "闀挎枃鏈�",
VTDate: "鏃ユ湡",
@@ -1410,9 +1477,9 @@
VTString: "瀛楃涓�"
},
//鏃堕棿鏍煎紡涓嬫媺妗�
- codeDataFlag:false,
- // 缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~
- componentRuleText:"",
+ codeDataFlag: false,
+ // 缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~
+ componentRuleText: "",
//妯℃澘灞炴�т笅鎷夎缃畇witch
selectoptions: [{
value: 'keyAttrFlag',
@@ -1456,10 +1523,10 @@
}],
//妯℃澘灞炴�т笅鎷夐�変腑鍊�
selectvalue: 'keyAttrFlag',
- switchvalue:'false'
+ switchvalue: 'false'
}
},
- computed:{
+ computed: {
attrOids() {
let oids = [];
this.attrSelectList.forEach(ele => {
@@ -1478,86 +1545,80 @@
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.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.attrModel = "";
- this.attrVisible = false;
+ this.attrClose()
},
//灞炴�у垎缁勬竻绌�
attrRemove() {
this.attrModel = ""
},
+ attrClose() {
+ this.attrModel = "";
+ 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 => {
@@ -1582,7 +1643,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],
@@ -1601,7 +1662,7 @@
queryAttrFlag: 'true',
seniorQueryAttrFlag: 'true',
attrTableWidth: 120,
- ts:""
+ ts: ""
})
this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList)))
}
@@ -1611,18 +1672,20 @@
//涓氬姟绫诲瀷閫夋嫨
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;
})
},
@@ -1646,37 +1709,39 @@
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;
},
- rowClick(row){
+ rowClick(row) {
this.$refs.referAttrCrud.clearSelection();
this.attrSelectList = [row];
this.$refs.referAttrCrud.setCurrentRow(row);
@@ -1686,67 +1751,144 @@
this.attrRow = row;
},
//淇濆瓨
- addsHandler() {
- batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => {
- this.$message.success('淇濆瓨鎴愬姛')
- this.editOpenFlag=false
- }).catch(()=>{
- this.$message.warning('淇濆瓨澶辫触锛岃鏌ョ湅鎺у埗鍙拌緭鍑猴紒')
+ addsHandler(event) {
+ this.$refs.referAttrCrud.sort("orderNum");
+ var ischeck = true;
+ console.log('ProData',this.ProData)
+ 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.$message.success('淇濆瓨鎴愬姛')
+ this.editOpenFlag = false;
+ // 璋冪敤鐖剁粍浠朵慨鏀规寜閽姸鎬�
+ 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:'',
- }
- }
- 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,
- limit:-1
- }).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;
- }else if(column.property == 'attributeGroup'){
- this.attrVisible = true;
- }
- }
+ console.log(row,column)
+ 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();
+ }
+ });
+ 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;
+ this.tableData=[];
+ if (this.CurrentCell.enumString != "") {
+ this.tableData = JSON.parse(this.CurrentCell.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
+ }
+ }
+ }
},
saveRows() {
this.editingRows = null;
+ this.editShows = null;
+ // const inputElement = document.querySelector(`#inputRef${this.CurrentCell.oid}`);
+ // if (inputElement) {
+ // inputElement.blur();
+ // }
},
// 鏋氫妇娉ㄥ叆娣诲姞涓�琛岀┖鏁版嵁
addRow() {
@@ -1772,20 +1914,20 @@
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) {
@@ -1793,28 +1935,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锛屽嵆閫�鍑虹紪杈戠姸鎬�
@@ -1822,41 +1968,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('鏍¢獙鎴愬姛')
}
},
@@ -1876,58 +2024,42 @@
let data = {
"娉ㄥ叆绫诲瀷": this.injectOption.classifyInvokeAttr,
"娉ㄥ叆绫诲瀷鍚嶇О": this.injectOption.classifyInvokeAttrName,
- "灞傜骇璁剧疆": this.injectOption.classifyInvokeLevel=='max'?this.injectOption.classifyNumber :'min',
+ "灞傜骇璁剧疆": this.injectOption.classifyInvokeLevel == 'max' ? this.injectOption.classifyNumber : 'min',
"鏄惁鍙慨鏀�": this.injectOption.classifyInvokeEditFlag
}
- //鍗曞厓鏍肩紪杈戣祴鍊间竴閬�
- // noinspection JSCheckFunctionSignatures
- if(this.CurrentCell){
+ //鍕鹃�夋搷浣�
+ for (const key in this.injectOption) {
+ this.attrSelectList[0][key] = this.injectOption[key];
//濡傛灉鏄寚瀹氬眰璧嬪�间负鏁板瓧
- if(this.injectOption.classifyInvokeLevel!== 'min'){
- this.CurrentCell.classifyInvokeLevel=this.injectOption.classifyNumber
- }else {
- this.CurrentCell.classifyInvokeLevel='min'
+ if (this.injectOption.classifyInvokeLevel !== 'min') {
+ this.attrSelectList[0].classifyInvokeLevel = this.injectOption.classifyNumber
+ } else {
+ this.attrSelectList[0].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()
+ this.$set(this.attrSelectList[0], 'classifyInvokeText', data)
}
- if(this.injectOption.classifyInvokeLevel !== 'min'){
- this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber;
- }else {
- this.injectOption.classifyNumber=0;
+ // this.injectHandleReset()
+ if (this.injectOption.classifyInvokeLevel !== 'min') {
+ this.injectOption.classifyInvokeLevel = this.injectOption.classifyNumber;
+ } else {
+ this.injectOption.classifyNumber = 0;
}
this.injectVisible = false;
},
//鍒嗙被娉ㄥ叆娓呯┖
injectHandleReset() {
- this.injectOption.classifyInvokeAttrName = "鍒嗙被鍚嶇О";
- this.injectOption.classifyInvokeAttr = "name";
- this.injectOption.classifyInvokeLevel = "min";
- this.injectOption.classifyInvokeEditFlag = "true";
- this.injectOption.classifyNumber = "0";
+ this.$set(this.CurrentCell, 'classifyInvokeText', '')
+ this.$set(this.CurrentCell, 'classifyInvokeAttr:', '')
+ this.$set(this.CurrentCell, 'classitwInvokeAttrName', '')
+ this.$set(this.CurrentCell, 'classifyInvokeEditFlag', 'false')
+ this.$set(this.CurrentCell, 'classifyInvokeLevel', 'none')
+ this.injectVisible = false;
},
// 鍒嗙被娉ㄥ叆鍙栨秷
injectRemove() {
- this.injectVisible = false
+ this.injectVisible = false;
+ this.injectHandleReset()
},
//灞炴�фā鏉胯〃鏍煎崟鍏冩牸鐐瑰嚮浜嬩欢
//琛ㄦ牸鎿嶄綔鏍忓垹闄�
@@ -1936,7 +2068,7 @@
},
//琛ㄦ牸鍒犻櫎
CrudRemove() {
- this.attrSelectList.forEach((item)=>{
+ this.attrSelectList.forEach((item) => {
const index = this.ProData.indexOf(item);
this.ProData.splice(index, 1)
})
@@ -1968,7 +2100,7 @@
} else if (this.attrSelectList.length < 1) {
this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬ф暟鎹�')
} else if (this.attrSelectList.length === 1) {
- this.isShowformulaEdit=true
+ this.isShowformulaEdit = true
}
},
//鍏ㄥ睆缂栬緫
@@ -1976,9 +2108,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;
}
},
@@ -1986,50 +2119,57 @@
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)
},
//寮�鍚紪杈�
- editOpen(){
- this.editOpenFlag=true;
+ editOpen() {
+ this.editOpenFlag = true;
+ this.AddCellFlag=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" >
+<style lang="scss" scoped>
.app {
- /deep/ .el-button {
- //margin: 0 10px 10px 0;
- }
+ /deep/ .el-button {
+ //margin: 0 10px 10px 0;
+ }
}
+
.el-button-group {
margin-right: 10px;
margin-bottom: 10px;
--
Gitblit v1.9.3