表格类型需求变动完善

This commit is contained in:
mrs_12345@163.com 2022-06-28 20:01:51 +08:00
parent 8d0353e568
commit 6d40c53630
2 changed files with 53 additions and 26 deletions

View File

@ -335,9 +335,18 @@
<awsui-form-item label="类型">
<awsui-select v-model="attrForm.type" :disabled="!attrForm.isCreate" :options="attrForm.typeOpts" @change="changeAttrType"></awsui-select>
</awsui-form-item>
<awsui-form-item label="属性描述" prop="desc">
<awsui-input v-model="attrForm.desc" placeholder="请输入属性描述"></awsui-input>
</awsui-form-item>
<!-- table限制 -->
<template v-if="attrForm.type=='table'">
<awsui-form-item label="表格列名1" >
<awsui-input v-model="attrForm.tableRef.firstColumn" placeholder="请输入列名1"></awsui-input>
</awsui-form-item>
<awsui-form-item label="表格列名2">
<awsui-input v-model="attrForm.tableRef.secondColumn" placeholder="请输入列名2"></awsui-input>
</awsui-form-item>
</template>
<awsui-form-item label="属性描述" prop="desc">
<awsui-input v-model="attrForm.desc" placeholder="请输入属性描述"></awsui-input>
</awsui-form-item>
<!-- relation限制 -->
<template v-if="attrForm.type=='relation'">
<awsui-form-item label="关联的建模方法">
@ -505,6 +514,10 @@
scope: [],
multiple: 'false'
},
tableRef: {
firstColumn: '',
secondColumn: '',
},
value: '',
readonly: false,
isRequired: false,
@ -791,6 +804,10 @@
scope: [],
multiple: 'false'
},
tableRef: {
firstColumn: '',
secondColumn: ''
},
value: '',
readonly: false,
isRequired: false,
@ -869,6 +886,10 @@
form.awsorgRef.scope = row.awsorgRef.scope;
form.awsorgRef.multiple = row.awsorgRef.multiple ? "true" : "false";
}
if (form.type == 'table') {
form.tableRef.firstColumn = row.tableRef.firstColumn
form.tableRef.secondColumn = row.tableRef.secondColumn
}
// pal bpm
let arr = ['relation','awsorg'];
let type = form.type;
@ -889,7 +910,6 @@
form.bpmShapeShow = row.bpmFileShow;
this.initDrawer('修改属性');
this.getAttrOptsParam(row.scope);
console.log(this.attrForm)
},
//
getAttrOptsParam(scope) {
@ -1006,6 +1026,14 @@
form.ref.multiple = form.ref.multiple == 'true' ? true : false;// boolean
form.ref = JSON.stringify(form.ref);
}
if (form.type == 'table') {
if (form.tableRef.firstColumn == '' || form.tableRef.secondColumn == '') {
that.$message({message: '[列名]不允许为空',type: 'warning'});
return false;
}
form.ref = form.tableRef;
form.ref = JSON.stringify(form.ref);
}
const data = {
url:'jd',
data:{
@ -1245,6 +1273,8 @@
this.attrForm.relationRef.type = '';
this.attrForm.awsorgRef.scope = [];
this.attrForm.awsorgRef.multiple = 'false';
this.attrForm.tableRef.firstColumn = ''
this.attrForm.tableRef.secondColumn = ''
this.attrForm.value = '';
},
initDrawerBodyHeight() {

View File

@ -172,7 +172,7 @@
<div class="property-item">
<label class="property-label">{{item.label}}</label>
<div class="property-value">
<el-input :size=size :disabled="item.readonly" v-model="item.value.name">
<el-input :size=size :disabled="item.readonly" readonly v-model="dialogTableInput">
<template slot="suffix">
<i style="font-size: 20px;line-height: 36px" class="el-icon-s-grid" @click="openTableDialog(item.id,item.value,item.attrSource)"></i>
</template>
@ -214,6 +214,7 @@
id="tableDialog"
width="500px"
:visible.sync="tableDialogVisible"
:title="dialogTableNewValue.name"
v-if="tableDialogVisible"
:modal-append-to-body=true
:close-on-click-modal=false
@ -221,30 +222,18 @@
:show-close=false
destroy-on-close
>
<template slot="title">
<el-tooltip placement="top-start">
<div slot="content">{{ dialogTableNewValue.name }}</div>
<el-input class="titleInput" v-model="dialogTableNewValue.name"/>
</el-tooltip>
</template>
<div style="height: 300px;overflow: auto;">
<table class="table">
<tr>
<td style="width: 25%">
<el-tooltip placement="top-start">
<div slot="content">{{ dialogTableNewValue.table[0].name }}</div>
<el-input class="headInput" v-model="dialogTableNewValue.table[0].name" size="mini"/>
</el-tooltip>
<span class="tableHead">{{ dialogTableNewValue.table[0].name }}</span>
</td>
<td style="width: 55%">
<el-tooltip placement="top-start">
<div slot="content">{{ dialogTableNewValue.table[0].name }}</div>
<el-input class="headInput" v-model="dialogTableNewValue.table[0].desc" size="mini"/>
</el-tooltip>
<span class="tableHead">{{ dialogTableNewValue.table[0].desc }}</span>
</td>
<td><span style="font-size: 14px;color: #909399;font-weight: bold;font-family: PingFangSC-Light;">操作</span></td>
</tr>
<tr v-for="item in dialogTableNewValue.table.slice(1)">
<tr v-for="item in dialogTableNewValue.table.slice(1)" :key="item.id">
<td>
<el-tooltip placement="top-start">
<div slot="content">{{ item.name }}</div>
@ -328,6 +317,7 @@
currRelationType: '',
currPropSource: '',
tableDialogVisible: false,
dialogTableInput: '请输入',
dialogTableId: '',
dialogTableOldValue: {}, // dialog
dialogTableNewValue: { //
@ -362,13 +352,19 @@
propertyData.forEach(item => {
item.data.forEach(item1 => {
if (item1.type == 'table' && JSON.stringify(item1.value) == '{}') {
let tableRef = JSON.parse(item1.ref)
item1.value = {
name: '未命名表单',
table: [
{ id: 'table_head',name: '命名',desc: '描述'}
name: item1.label,
table:[
{ id: 'table_head',name: tableRef.firstColumn,desc: tableRef.secondColumn}
]
}
}
if (item1.type == 'table' && JSON.stringify(item1.value) !== '{}') {
that.dialogTableInput = item1.value.table.length > 1 ? '请查看' : '请输入'
let tableRef = JSON.parse(item1.ref)
item1.value.table[0] = { id: 'table_head',name: tableRef.firstColumn,desc: tableRef.secondColumn}
}
})
})
that.propertyData = propertyData;
@ -680,18 +676,19 @@
display: inline-block;
width: 85%;
}
#tableDialog {
cursor: pointer;
}
#tableDialog >>> .el-dialog__body {
padding: 10px 20px;
color: #606266;
font-size: 14px;
word-break: break-all;
cursor: pointer;
}
#tableDialog >>> .el-input__inner {
border: none;
padding: 0;
text-overflow: ellipsis;
cursor: pointer;
}
.table {
width: 100%;
@ -709,7 +706,7 @@
font-size: 18px;
font-family: PingFangSC-Light;
}
.headInput >>> .el-input__inner {
.tableHead {
font-size: 14px;
color: #909399;
font-weight: bold;