|
|
|
|
@ -32,15 +32,27 @@
|
|
|
|
|
<template v-if="column.component=='AddressDetails'">
|
|
|
|
|
{{ addressModification(column, record) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.component=='CheckboxGroup'">
|
|
|
|
|
{{ checkFroupModification(column, record) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template
|
|
|
|
|
v-if="
|
|
|
|
|
['TreeSelect', 'Cascader', 'CheckboxGroup', 'Transfer', 'RangePicker'].includes(
|
|
|
|
|
['TreeSelect', 'Cascader', 'Transfer', 'RangePicker'].includes(
|
|
|
|
|
column.component,
|
|
|
|
|
)
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
{{ dataModification(column, record) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.key === 'action'">
|
|
|
|
|
<div class="flex ai-c jc-c linebtnbox">
|
|
|
|
|
<div class="linebtnboxli" v-for="(item, index) in linebtnArr" :key="index">
|
|
|
|
|
<a-button size="small" v-if="item.isRowBtn" :type="item.class" @click="handleClickForm(item.prop,record)">{{
|
|
|
|
|
item.label
|
|
|
|
|
}}</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
|
|
|
|
|
@ -165,6 +177,7 @@
|
|
|
|
|
{ label: '删除', prop: 'Delete', class: 'error' },
|
|
|
|
|
{ label: '详情', prop: 'Details', class: 'default' },
|
|
|
|
|
]);
|
|
|
|
|
const linebtnArr = ref([])
|
|
|
|
|
const mapSetData = ref({
|
|
|
|
|
width: 100,
|
|
|
|
|
});
|
|
|
|
|
@ -309,7 +322,7 @@
|
|
|
|
|
|
|
|
|
|
const [registerMapFormModal, { openModal: openMapFormModal }] = useModal();
|
|
|
|
|
|
|
|
|
|
const [registerTable, { reload, setColumns, getSelectRows, clearSelectedRowKeys }] = useTable({
|
|
|
|
|
const [registerTable, { reload, setColumns,setProps, getSelectRows, clearSelectedRowKeys }] = useTable({
|
|
|
|
|
title: '表单列表',
|
|
|
|
|
api: getFormsPageData,
|
|
|
|
|
// rowKey: 'f_Id',
|
|
|
|
|
@ -326,6 +339,12 @@
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
bordered: true,
|
|
|
|
|
actionColumn: {
|
|
|
|
|
ifShow: false,
|
|
|
|
|
width: 200,
|
|
|
|
|
title: '操作',
|
|
|
|
|
dataIndex: 'action',
|
|
|
|
|
},
|
|
|
|
|
beforeFetch: (data) => {
|
|
|
|
|
// 接口请求前 参数处理
|
|
|
|
|
const querys = JSON.parse(JSON.stringify(data));
|
|
|
|
|
@ -455,9 +474,15 @@
|
|
|
|
|
FiledValue: Array<any>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleClickForm = (status) => {
|
|
|
|
|
const handleClickForm = (status,record) => {
|
|
|
|
|
console.log('aaaa', record)
|
|
|
|
|
const config = cloneDeep(formConfig.value);
|
|
|
|
|
const rows = getSelectRows();
|
|
|
|
|
const rows = ref([])
|
|
|
|
|
if(record){
|
|
|
|
|
rows.value.push(record)
|
|
|
|
|
}else{
|
|
|
|
|
rows.value = getSelectRows()
|
|
|
|
|
}
|
|
|
|
|
const query: any = ref({
|
|
|
|
|
id: paramsId.value,
|
|
|
|
|
key: designData.value.primaryKey,
|
|
|
|
|
@ -472,8 +497,8 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (rows.length > 0) {
|
|
|
|
|
query.value.keyValue = rows[0][str.value];
|
|
|
|
|
if (rows.value.length > 0) {
|
|
|
|
|
query.value.keyValue = rows.value[0][str.value];
|
|
|
|
|
}
|
|
|
|
|
console.log('config', config);
|
|
|
|
|
switch (status) {
|
|
|
|
|
@ -514,10 +539,9 @@
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 'Edit':
|
|
|
|
|
if (rows.length == 0) {
|
|
|
|
|
if (rows.value.length == 0) {
|
|
|
|
|
return createMessage.warn('请选择一条数据进行编辑');
|
|
|
|
|
}
|
|
|
|
|
// console.log('rowsrows',formConfig,rows);
|
|
|
|
|
|
|
|
|
|
btnList.value.forEach((element) => {
|
|
|
|
|
if (element.prop === 'Edit' && element.isWFlow) {
|
|
|
|
|
@ -529,7 +553,7 @@
|
|
|
|
|
isDetail: false,
|
|
|
|
|
isUpdate: true,
|
|
|
|
|
tab: config.schemas,
|
|
|
|
|
record: rows[0],
|
|
|
|
|
record: rows.value[0],
|
|
|
|
|
recordChildren: formData.value,
|
|
|
|
|
query: query.value,
|
|
|
|
|
btnList: btnList.value,
|
|
|
|
|
@ -553,7 +577,7 @@
|
|
|
|
|
// );
|
|
|
|
|
// openModal(true, toProps);
|
|
|
|
|
// previewOpen.value = true;
|
|
|
|
|
// flowFormData.value = rows[0];
|
|
|
|
|
// flowFormData.value = rows.value[0];
|
|
|
|
|
// isUpdate.value = true;
|
|
|
|
|
openModal(true, toProps);
|
|
|
|
|
} else {
|
|
|
|
|
@ -561,12 +585,12 @@
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
previewOpen.value = true;
|
|
|
|
|
flowFormData.value = rows[0];
|
|
|
|
|
flowFormData.value = rows.value[0];
|
|
|
|
|
isUpdate.value = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'Delete':
|
|
|
|
|
if (rows.length == 0) {
|
|
|
|
|
if (rows.value.length == 0) {
|
|
|
|
|
return createMessage.warn('请选择一条数据进行删除');
|
|
|
|
|
}
|
|
|
|
|
createConfirm({
|
|
|
|
|
@ -589,14 +613,14 @@
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case 'Details':
|
|
|
|
|
if (rows.length == 0) {
|
|
|
|
|
if (rows.value.length == 0) {
|
|
|
|
|
return createMessage.warn('请选择一条数据查看详情');
|
|
|
|
|
}
|
|
|
|
|
let toProps = {
|
|
|
|
|
isDetail: true,
|
|
|
|
|
isUpdate: false,
|
|
|
|
|
tab: config.schemas,
|
|
|
|
|
record: rows[0],
|
|
|
|
|
record: rows.value[0],
|
|
|
|
|
recordChildren: formData.value,
|
|
|
|
|
query: query.value,
|
|
|
|
|
btnList: btnList.value,
|
|
|
|
|
@ -610,11 +634,9 @@
|
|
|
|
|
// showFormModalData.value = toProps;
|
|
|
|
|
// openShowFormModal.value = true;
|
|
|
|
|
// 根据ids获取图斑
|
|
|
|
|
console.log(rows);
|
|
|
|
|
console.log("formConfig");
|
|
|
|
|
try {
|
|
|
|
|
console.log('formConfig', formConfig);
|
|
|
|
|
handlerShowGeomtrys(formConfig, rows[0]);
|
|
|
|
|
handlerShowGeomtrys(formConfig, rows.value[0]);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
createMessage.error('当前数据没有图斑!');
|
|
|
|
|
}
|
|
|
|
|
@ -778,7 +800,7 @@
|
|
|
|
|
// 为使用字典字段的下拉组件的options赋值
|
|
|
|
|
formObj.formInfo.tabList.forEach((childTab) => {
|
|
|
|
|
childTab.schemas.forEach(async (item) => {
|
|
|
|
|
if (item.component === 'Select' && item.dataType === '2') {
|
|
|
|
|
if (item.component === 'Select' || item.component === 'CheckboxGroup' || item.component === 'RadioGroup' && item.dataType === '2') {
|
|
|
|
|
item.componentProps.options = await formCallStore.getDictionaryOptions(item.dataCode);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -831,6 +853,22 @@
|
|
|
|
|
paramsId.value = res.formScheme.id;
|
|
|
|
|
btnList.value = columnObj.table.btns;
|
|
|
|
|
btnArr.value = columnObj.table.btns;
|
|
|
|
|
linebtnArr.value = []
|
|
|
|
|
columnObj.table.btns.forEach(item =>{
|
|
|
|
|
if(item.isRowBtn){
|
|
|
|
|
linebtnArr.value.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(linebtnArr.value.length>0){
|
|
|
|
|
setProps({
|
|
|
|
|
actionColumn: {
|
|
|
|
|
ifShow: true,
|
|
|
|
|
width: 200,
|
|
|
|
|
title: '操作',
|
|
|
|
|
dataIndex: 'action',
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (columnObj.table.columns) {
|
|
|
|
|
columnObj.table.columns.forEach((item) => {
|
|
|
|
|
callColumns.push({
|
|
|
|
|
@ -865,6 +903,12 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
searchFormSchema.forEach(item =>{
|
|
|
|
|
if(item.component == 'Input'){
|
|
|
|
|
item.componentProps.disabled = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('searchFormSchema',searchFormSchema)
|
|
|
|
|
callColumns.forEach((item) => {
|
|
|
|
|
formObj.formInfo.schemas.forEach((val) => {
|
|
|
|
|
if (item.dataIndex == val.field && val.componentProps.options) {
|
|
|
|
|
@ -1033,7 +1077,16 @@
|
|
|
|
|
}else{
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const checkFroupModification = (column, record) => {
|
|
|
|
|
let arr = JSON.parse(
|
|
|
|
|
record[column.dataIndex]?.replace(/\r\n/g, '') || '[]',
|
|
|
|
|
);
|
|
|
|
|
if(arr){
|
|
|
|
|
return arr.join(',')
|
|
|
|
|
}else{
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 表单列表数据修饰
|
|
|
|
|
@ -1120,10 +1173,6 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// console.log(1080);
|
|
|
|
|
// console.log(column);
|
|
|
|
|
// console.log(record);
|
|
|
|
|
// console.log(searchFormSchema);
|
|
|
|
|
res = record[column.dataIndex];
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
@ -1199,4 +1248,16 @@
|
|
|
|
|
height: 750px;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
}
|
|
|
|
|
.ai-c{
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
.jc-c{
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
.linebtnbox{
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
.linebtnboxli{
|
|
|
|
|
margin: 0 3px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|