From 8310a8fb31e4a82cbbb8bb512e9815709f23d441 Mon Sep 17 00:00:00 2001
From: fujunling <2984387807@qq.com>
Date: 星期二, 11 七月 2023 19:08:02 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
---
Source/UBCS-WEB/src/components/Tree/attrCrud.vue | 62 ++++++++++++++++++-------------
1 files changed, 36 insertions(+), 26 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
index 63aa823..92ee657 100644
--- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag">
+ <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app">
<el-button-group>
<!--鏂板-->
<el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">娣诲姞 {{ msg }}</el-button>
@@ -242,7 +242,7 @@
</div>
<el-table :data="ProData"
style="width: 100%"
- height="280"
+ :height='attrEditVisible == false && attrFlagChiledren==false?400 :750'
@cell-click="handleCellClicks"
@select="selectHandle"
@selection-change="selectionChange"
@@ -270,12 +270,12 @@
@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' " @focus="DataChangeHandler(item.editConfig,index)">
+ <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.key"
- :label="optionItem.value"
- :value="optionItem.key">
+ :key="optionItem.dictValue"
+ :label="optionItem.dictValue"
+ :value="optionItem.dictValue">
</el-option>
</el-select>
<el-switch
@@ -304,6 +304,7 @@
<script>
import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr'
+import {getList} from "@/api/refer/table";
export default {
name: "attrCrud .vue",
@@ -935,11 +936,13 @@
column: [
{
label: "灞炴�ц嫳鏂囧悕绉�",
- prop: "id"
+ prop: "id",
+ width:110
},
{
label: "灞炴�т腑鏂囧悕绉�",
- prop: "name"
+ prop: "name",
+ width:110
},
{
label: "闀垮害",
@@ -1359,7 +1362,11 @@
)
},
created() {
-
+ this.option.column.forEach((item,index) => {
+ if (item.edit == 'select') {
+ this.selectChangeHandler(item.editConfig,index)
+ }
+ })
},
methods: {
formAttr(row, column) {
@@ -1389,17 +1396,20 @@
this.$set(this.CurrentCell,'referConfig',JSON.stringify(val))
},
- //鏃堕棿涓嬫媺鏍煎紡
- DataChangeHandler(editConfig,index){
+ //鍙緭鍙�変笅鎷�
+ 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=>{
- console.log(res);
- this.option.column[index].data=res;
+ that.option.column[index].data=res.data.data;
})
},
//灞炴�у垎缁勬寜閽�
attrVisibleHandle() {
if (this.attrSelectList < 1) {
- this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬�')
+ this.$message.warning('璇烽�夋嫨妯℃澘灞炴��')
} else {
this.attrVisible = true;
console.log(this.attrSelectList)
@@ -1476,6 +1486,7 @@
//涓氬姟绫诲瀷閫夋嫨
businessSelect(selection, row) {
this.busineSelectList = selection
+ console.log(selection)
},
// 浠庝笟鍔$被鍨嬩腑閫夋嫨鏁版嵁寮圭獥
busineHandle() {
@@ -1579,8 +1590,6 @@
}else if(column.property == 'verifyRule'){
this.RulesForm.expressionTextt=this.CurrentCell.verifyRule;
this.rulesVisible=true;
- console.log(this.CurrentCell.verifyRule)
- console.log(this.RulesForm.expressionText)
}
},
saveRows() {
@@ -1646,11 +1655,9 @@
},
//楠岃瘉瑙勫垯鎸夐挳
ruleAddHandler(){
- if(this.attrSelectList.length>1){
- this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�')
- }else if(this.attrSelectList.length<1){
- this.$message.warning('璇烽�夋嫨涓�鎻愭ā鏉垮睘鎬�')
- }else if(this.attrSelectList.length === 1){
+ if (this.attrSelectList < 1) {
+ this.$message.warning('璇烽�夋嫨妯℃澘灞炴��')
+ } else{
this.rulesVisible=true
}
@@ -1667,11 +1674,12 @@
},
// 楠岃瘉瑙勫垯纭畾
rulesHandle() {
- if(this.CurrentCell.length>0){
+ if(this.CurrentCell){
this.$set(this.CurrentCell,'verifyRule',this.RulesForm.expressionText)
}else {
- console.log(this.attrSelectList)
- this.$set(this.attrSelectList[0],'verifyRule',this.RulesForm.expressionText)
+ this.attrSelectList.forEach((item)=>{
+ this.$set(item,'verifyRule',this.RulesForm.expressionText)
+ })
this.rulesremove()
}
this.rulesVisible = false
@@ -1808,7 +1816,9 @@
</script>
<style scoped lang="scss" >
-/deep/ .el-button {
- margin: 0 10px 10px 0;
+.app {
+ /deep/ .el-button {
+ margin: 0 10px 10px 0;
+ }
}
</style>
--
Gitblit v1.9.3