表格类型需求变动完善
This commit is contained in:
parent
8d0353e568
commit
6d40c53630
@ -335,9 +335,18 @@
|
|||||||
<awsui-form-item label="类型">
|
<awsui-form-item label="类型">
|
||||||
<awsui-select v-model="attrForm.type" :disabled="!attrForm.isCreate" :options="attrForm.typeOpts" @change="changeAttrType"></awsui-select>
|
<awsui-select v-model="attrForm.type" :disabled="!attrForm.isCreate" :options="attrForm.typeOpts" @change="changeAttrType"></awsui-select>
|
||||||
</awsui-form-item>
|
</awsui-form-item>
|
||||||
<awsui-form-item label="属性描述" prop="desc">
|
<!-- table限制 -->
|
||||||
<awsui-input v-model="attrForm.desc" placeholder="请输入属性描述"></awsui-input>
|
<template v-if="attrForm.type=='table'">
|
||||||
</awsui-form-item>
|
<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限制 -->
|
<!-- relation限制 -->
|
||||||
<template v-if="attrForm.type=='relation'">
|
<template v-if="attrForm.type=='relation'">
|
||||||
<awsui-form-item label="关联的建模方法">
|
<awsui-form-item label="关联的建模方法">
|
||||||
@ -505,6 +514,10 @@
|
|||||||
scope: [],
|
scope: [],
|
||||||
multiple: 'false'
|
multiple: 'false'
|
||||||
},
|
},
|
||||||
|
tableRef: {
|
||||||
|
firstColumn: '',
|
||||||
|
secondColumn: '',
|
||||||
|
},
|
||||||
value: '',
|
value: '',
|
||||||
readonly: false,
|
readonly: false,
|
||||||
isRequired: false,
|
isRequired: false,
|
||||||
@ -791,6 +804,10 @@
|
|||||||
scope: [],
|
scope: [],
|
||||||
multiple: 'false'
|
multiple: 'false'
|
||||||
},
|
},
|
||||||
|
tableRef: {
|
||||||
|
firstColumn: '',
|
||||||
|
secondColumn: ''
|
||||||
|
},
|
||||||
value: '',
|
value: '',
|
||||||
readonly: false,
|
readonly: false,
|
||||||
isRequired: false,
|
isRequired: false,
|
||||||
@ -869,6 +886,10 @@
|
|||||||
form.awsorgRef.scope = row.awsorgRef.scope;
|
form.awsorgRef.scope = row.awsorgRef.scope;
|
||||||
form.awsorgRef.multiple = row.awsorgRef.multiple ? "true" : "false";
|
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 时 只读行为不可选
|
// 类型为pal bpm 时 只读行为不可选
|
||||||
let arr = ['relation','awsorg'];
|
let arr = ['relation','awsorg'];
|
||||||
let type = form.type;
|
let type = form.type;
|
||||||
@ -889,7 +910,6 @@
|
|||||||
form.bpmShapeShow = row.bpmFileShow;
|
form.bpmShapeShow = row.bpmFileShow;
|
||||||
this.initDrawer('修改属性');
|
this.initDrawer('修改属性');
|
||||||
this.getAttrOptsParam(row.scope);
|
this.getAttrOptsParam(row.scope);
|
||||||
console.log(this.attrForm)
|
|
||||||
},
|
},
|
||||||
// 获取一些选择框参数
|
// 获取一些选择框参数
|
||||||
getAttrOptsParam(scope) {
|
getAttrOptsParam(scope) {
|
||||||
@ -1006,6 +1026,14 @@
|
|||||||
form.ref.multiple = form.ref.multiple == 'true' ? true : false;// 转换为boolean
|
form.ref.multiple = form.ref.multiple == 'true' ? true : false;// 转换为boolean
|
||||||
form.ref = JSON.stringify(form.ref);
|
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 = {
|
const data = {
|
||||||
url:'jd',
|
url:'jd',
|
||||||
data:{
|
data:{
|
||||||
@ -1245,6 +1273,8 @@
|
|||||||
this.attrForm.relationRef.type = '';
|
this.attrForm.relationRef.type = '';
|
||||||
this.attrForm.awsorgRef.scope = [];
|
this.attrForm.awsorgRef.scope = [];
|
||||||
this.attrForm.awsorgRef.multiple = 'false';
|
this.attrForm.awsorgRef.multiple = 'false';
|
||||||
|
this.attrForm.tableRef.firstColumn = ''
|
||||||
|
this.attrForm.tableRef.secondColumn = ''
|
||||||
this.attrForm.value = '';
|
this.attrForm.value = '';
|
||||||
},
|
},
|
||||||
initDrawerBodyHeight() {
|
initDrawerBodyHeight() {
|
||||||
|
|||||||
@ -172,7 +172,7 @@
|
|||||||
<div class="property-item">
|
<div class="property-item">
|
||||||
<label class="property-label">{{item.label}}</label>
|
<label class="property-label">{{item.label}}</label>
|
||||||
<div class="property-value">
|
<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">
|
<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>
|
<i style="font-size: 20px;line-height: 36px" class="el-icon-s-grid" @click="openTableDialog(item.id,item.value,item.attrSource)"></i>
|
||||||
</template>
|
</template>
|
||||||
@ -214,6 +214,7 @@
|
|||||||
id="tableDialog"
|
id="tableDialog"
|
||||||
width="500px"
|
width="500px"
|
||||||
:visible.sync="tableDialogVisible"
|
:visible.sync="tableDialogVisible"
|
||||||
|
:title="dialogTableNewValue.name"
|
||||||
v-if="tableDialogVisible"
|
v-if="tableDialogVisible"
|
||||||
:modal-append-to-body=true
|
:modal-append-to-body=true
|
||||||
:close-on-click-modal=false
|
:close-on-click-modal=false
|
||||||
@ -221,30 +222,18 @@
|
|||||||
:show-close=false
|
:show-close=false
|
||||||
destroy-on-close
|
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;">
|
<div style="height: 300px;overflow: auto;">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 25%">
|
<td style="width: 25%">
|
||||||
<el-tooltip placement="top-start">
|
<span class="tableHead">{{ dialogTableNewValue.table[0].name }}</span>
|
||||||
<div slot="content">{{ dialogTableNewValue.table[0].name }}</div>
|
|
||||||
<el-input class="headInput" v-model="dialogTableNewValue.table[0].name" size="mini"/>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 55%">
|
<td style="width: 55%">
|
||||||
<el-tooltip placement="top-start">
|
<span class="tableHead">{{ dialogTableNewValue.table[0].desc }}</span>
|
||||||
<div slot="content">{{ dialogTableNewValue.table[0].name }}</div>
|
|
||||||
<el-input class="headInput" v-model="dialogTableNewValue.table[0].desc" size="mini"/>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
</td>
|
||||||
<td><span style="font-size: 14px;color: #909399;font-weight: bold;font-family: PingFangSC-Light;">操作</span></td>
|
<td><span style="font-size: 14px;color: #909399;font-weight: bold;font-family: PingFangSC-Light;">操作</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="item in dialogTableNewValue.table.slice(1)">
|
<tr v-for="item in dialogTableNewValue.table.slice(1)" :key="item.id">
|
||||||
<td>
|
<td>
|
||||||
<el-tooltip placement="top-start">
|
<el-tooltip placement="top-start">
|
||||||
<div slot="content">{{ item.name }}</div>
|
<div slot="content">{{ item.name }}</div>
|
||||||
@ -328,6 +317,7 @@
|
|||||||
currRelationType: '',
|
currRelationType: '',
|
||||||
currPropSource: '',
|
currPropSource: '',
|
||||||
tableDialogVisible: false,
|
tableDialogVisible: false,
|
||||||
|
dialogTableInput: '请输入',
|
||||||
dialogTableId: '',
|
dialogTableId: '',
|
||||||
dialogTableOldValue: {}, // 弹框表格值副本 刚打开dialog的值 点击取消会把该值保存到数据库
|
dialogTableOldValue: {}, // 弹框表格值副本 刚打开dialog的值 点击取消会把该值保存到数据库
|
||||||
dialogTableNewValue: { // 弹框表格值 对表格的更新操作在此进行 点击确定会把该值保存到数据库
|
dialogTableNewValue: { // 弹框表格值 对表格的更新操作在此进行 点击确定会把该值保存到数据库
|
||||||
@ -362,13 +352,19 @@
|
|||||||
propertyData.forEach(item => {
|
propertyData.forEach(item => {
|
||||||
item.data.forEach(item1 => {
|
item.data.forEach(item1 => {
|
||||||
if (item1.type == 'table' && JSON.stringify(item1.value) == '{}') {
|
if (item1.type == 'table' && JSON.stringify(item1.value) == '{}') {
|
||||||
|
let tableRef = JSON.parse(item1.ref)
|
||||||
item1.value = {
|
item1.value = {
|
||||||
name: '未命名表单',
|
name: item1.label,
|
||||||
table: [
|
table:[
|
||||||
{ id: 'table_head',name: '命名',desc: '描述'}
|
{ 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;
|
that.propertyData = propertyData;
|
||||||
@ -680,18 +676,19 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 85%;
|
width: 85%;
|
||||||
}
|
}
|
||||||
|
#tableDialog {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
#tableDialog >>> .el-dialog__body {
|
#tableDialog >>> .el-dialog__body {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
color: #606266;
|
color: #606266;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
#tableDialog >>> .el-input__inner {
|
#tableDialog >>> .el-input__inner {
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
.table {
|
.table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -709,7 +706,7 @@
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-family: PingFangSC-Light;
|
font-family: PingFangSC-Light;
|
||||||
}
|
}
|
||||||
.headInput >>> .el-input__inner {
|
.tableHead {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #909399;
|
color: #909399;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user