|
|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
<div ref="lxHeader">
|
|
|
|
|
<LxHeader
|
|
|
|
|
icon="md-apps"
|
|
|
|
|
:text="title || customForm.tableName"
|
|
|
|
|
:text="$route.meta.title"
|
|
|
|
|
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
|
|
|
|
|
>
|
|
|
|
|
<div slot="content"></div>
|
|
|
|
|
@ -14,7 +14,7 @@
|
|
|
|
|
<template #search>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<Select
|
|
|
|
|
v-model="select.filter[0].key"
|
|
|
|
|
v-model="select.filter[1].key"
|
|
|
|
|
style="width: 100px"
|
|
|
|
|
placeholder="搜索条目"
|
|
|
|
|
>
|
|
|
|
|
@ -26,7 +26,7 @@
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
<Select
|
|
|
|
|
v-model="select.filter[0].op"
|
|
|
|
|
v-model="select.filter[1].op"
|
|
|
|
|
style="width: 100px; margin-left: 10px"
|
|
|
|
|
placeholder="搜索条件"
|
|
|
|
|
>
|
|
|
|
|
@ -39,43 +39,43 @@
|
|
|
|
|
</Select>
|
|
|
|
|
<template
|
|
|
|
|
v-if="
|
|
|
|
|
select.filter[0].op !== 'range' &&
|
|
|
|
|
!columnArrTest(select.filter[0].key)
|
|
|
|
|
select.filter[1].op !== 'range' &&
|
|
|
|
|
!columnArrTest(select.filter[1].key)
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<Input
|
|
|
|
|
v-model="select.filter[0].value"
|
|
|
|
|
v-model="select.filter[1].value"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="请填写关键词"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template
|
|
|
|
|
v-else-if="
|
|
|
|
|
select.filter[0].op !== 'range' &&
|
|
|
|
|
columnArrTest(select.filter[0].key)
|
|
|
|
|
select.filter[1].op !== 'range' &&
|
|
|
|
|
columnArrTest(select.filter[1].key)
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<Select
|
|
|
|
|
v-model="select.filter[0].value"
|
|
|
|
|
v-model="select.filter[1].value"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="请选择关键词"
|
|
|
|
|
>
|
|
|
|
|
<Option
|
|
|
|
|
v-for="item in getColumnParams(select.filter[0].key)"
|
|
|
|
|
v-for="item in getColumnParams(select.filter[1].key)"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:value="getColumnField(select.filter[0].key)._relations ? item[getColumnField(select.filter[0].key)._relations.foreign_key] : item.value"
|
|
|
|
|
:value="getColumnField(select.filter[1].key)._relations ? item[getColumnField(select.filter[1].key)._relations.foreign_key] : item.value"
|
|
|
|
|
>{{
|
|
|
|
|
item.key || item.value || item.name || item.no || item.id
|
|
|
|
|
item.key || item.value || item.name || item.no || item.mingcheng || item.id
|
|
|
|
|
}}</Option
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<Input
|
|
|
|
|
:value="select.filter[0].value.split(',')[0]"
|
|
|
|
|
:value="select.filter[1].value.split(',')[1]"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="范围开始关键词"
|
|
|
|
|
@input="(e) => inputStartHandler(e, select.filter[0])"
|
|
|
|
|
@input="(e) => inputStartHandler(e, select.filter[1])"
|
|
|
|
|
/>
|
|
|
|
|
<span
|
|
|
|
|
style="
|
|
|
|
|
@ -86,10 +86,10 @@
|
|
|
|
|
>至</span
|
|
|
|
|
>
|
|
|
|
|
<Input
|
|
|
|
|
:value="select.filter[0].value.split(',')[1]"
|
|
|
|
|
:value="select.filter[1].value.split(',')[1]"
|
|
|
|
|
style="width: 150px; margin-left: 10px"
|
|
|
|
|
placeholder="范围结束关键词"
|
|
|
|
|
@input="(e) => inputEndHandler(e, select.filter[0])"
|
|
|
|
|
@input="(e) => inputEndHandler(e, select.filter[1])"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<Button
|
|
|
|
|
@ -110,8 +110,9 @@
|
|
|
|
|
class="select__item"
|
|
|
|
|
v-for="(item, index) in select.filter"
|
|
|
|
|
:key="`${item.value}-${index}`"
|
|
|
|
|
v-if="index !== 0"
|
|
|
|
|
>
|
|
|
|
|
<p>条件{{ index + 1 }}</p>
|
|
|
|
|
<p>条件{{ index }}</p>
|
|
|
|
|
<Select
|
|
|
|
|
v-model="item.key"
|
|
|
|
|
style="width: 100px"
|
|
|
|
|
@ -162,7 +163,7 @@
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:value="getColumnField(item.key)._relations ? item[getColumnField(item.key)._relations.foreign_key] : item.value"
|
|
|
|
|
>{{
|
|
|
|
|
item.key || item.value || item.name || item.no || item.id
|
|
|
|
|
item.key || item.value || item.name || item.no || item.mingcheng || item.id
|
|
|
|
|
}}</Option
|
|
|
|
|
>
|
|
|
|
|
</Select>
|
|
|
|
|
@ -244,7 +245,7 @@
|
|
|
|
|
:border="true"
|
|
|
|
|
:action="index"
|
|
|
|
|
:req-opt="select"
|
|
|
|
|
:destroy-req-opt="select"
|
|
|
|
|
:destroy-req-opt="{ 'table_name': customForm.tableName }"
|
|
|
|
|
:table-item="table"
|
|
|
|
|
@detail="
|
|
|
|
|
(row) => {
|
|
|
|
|
@ -268,6 +269,9 @@
|
|
|
|
|
ref="dialog"
|
|
|
|
|
@refresh="$refs['xyTable'].getTableData()"
|
|
|
|
|
>
|
|
|
|
|
<template #fujian="{ fieldInfo, form, file }" v-if="$route.meta.params && $route.meta.params.type == 1">
|
|
|
|
|
<flow :field-info="fieldInfo" :form="form" :file="file"></flow>
|
|
|
|
|
</template>
|
|
|
|
|
</dialoger>
|
|
|
|
|
<drawer
|
|
|
|
|
:table-name="customForm.tableName"
|
|
|
|
|
@ -293,12 +297,15 @@ import { getparameter } from "@/api/system/dictionary";
|
|
|
|
|
import { show } from "@/api/system/customForm";
|
|
|
|
|
import * as XLSX from "xlsx";
|
|
|
|
|
import { saveAs } from "file-saver";
|
|
|
|
|
import { listdept } from "@/api/system/department";
|
|
|
|
|
import { deepCopy } from "@/utils";
|
|
|
|
|
|
|
|
|
|
import dialoger from "./dialog.vue";
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import headerContent from "@/components/LxHeader/XyContent.vue";
|
|
|
|
|
import drawer from "@/views/component/drawer.vue";
|
|
|
|
|
import imports from "./imports.vue";
|
|
|
|
|
import flow from "@/views/flow/flow.vue"
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
LxHeader,
|
|
|
|
|
@ -306,6 +313,8 @@ export default {
|
|
|
|
|
headerContent,
|
|
|
|
|
drawer,
|
|
|
|
|
imports,
|
|
|
|
|
|
|
|
|
|
flow
|
|
|
|
|
},
|
|
|
|
|
mixins: [authMixin],
|
|
|
|
|
provide: {
|
|
|
|
|
@ -313,11 +322,15 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
title: "",
|
|
|
|
|
op,
|
|
|
|
|
select: {
|
|
|
|
|
table_name: "",
|
|
|
|
|
filter: [
|
|
|
|
|
{
|
|
|
|
|
key: "leixing",
|
|
|
|
|
op: "eq",
|
|
|
|
|
value: this.$route.meta.params?.type,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "",
|
|
|
|
|
op: "",
|
|
|
|
|
@ -338,8 +351,13 @@ export default {
|
|
|
|
|
destroy,
|
|
|
|
|
download,
|
|
|
|
|
reset() {
|
|
|
|
|
this.select.filter.splice(1);
|
|
|
|
|
this.select.filter.splice(2);
|
|
|
|
|
this.select.filter[0] = {
|
|
|
|
|
key: "leixing",
|
|
|
|
|
op: "eq",
|
|
|
|
|
value: this.$route.meta.params?.type,
|
|
|
|
|
};
|
|
|
|
|
this.select.filter[1] = {
|
|
|
|
|
key: "",
|
|
|
|
|
op: "",
|
|
|
|
|
value: "",
|
|
|
|
|
@ -400,9 +418,16 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const res = await show({ id: this.customForm.customFormId }, false);
|
|
|
|
|
this.title = res.name;
|
|
|
|
|
|
|
|
|
|
//字段处理
|
|
|
|
|
//初始表
|
|
|
|
|
let baseTable = new Map([
|
|
|
|
|
['departments', async () => {
|
|
|
|
|
const res = await listdept()
|
|
|
|
|
return res
|
|
|
|
|
}],
|
|
|
|
|
['admins',[]]
|
|
|
|
|
])
|
|
|
|
|
let { fields, relation } = res;
|
|
|
|
|
if (
|
|
|
|
|
!fields ||
|
|
|
|
|
@ -423,49 +448,28 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (i.edit_input === 'file' || i.edit_input === 'files') {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (i._relations) {
|
|
|
|
|
i._params = i._relations.parameter_id
|
|
|
|
|
? getparameter({ id: i._relations.parameter_id },false).then((res) => {
|
|
|
|
|
i._params = res.detail;
|
|
|
|
|
})
|
|
|
|
|
: this.index({
|
|
|
|
|
table_name: i._relations.link_table_name,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
i._params = res.data;
|
|
|
|
|
});
|
|
|
|
|
if (baseTable.get(i._relations.link_table_name)) {
|
|
|
|
|
baseTable.get(i._relations.link_table_name)().then(res => i._params = res)
|
|
|
|
|
} else {
|
|
|
|
|
i._params = i._relations.parameter_id
|
|
|
|
|
? getparameter({ id: i._relations.parameter_id },false).then((res) => {
|
|
|
|
|
i._params = res.detail;
|
|
|
|
|
})
|
|
|
|
|
: this.index({
|
|
|
|
|
table_name: i._relations.link_table_name,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
i._params = res.data;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.form = fields;
|
|
|
|
|
console.log(111, this.form);
|
|
|
|
|
// if(res.fields && res.fields instanceof Array) {
|
|
|
|
|
// res.fields.forEach(i => {
|
|
|
|
|
// if (i.field) {
|
|
|
|
|
// if (
|
|
|
|
|
// (i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
|
|
|
|
|
// i.parameter_id
|
|
|
|
|
// ) {
|
|
|
|
|
// getparameter({ id: i.parameter_id }).then((res) => {
|
|
|
|
|
// i._paramters = res.detail ?? [];
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// if (
|
|
|
|
|
// (i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
|
|
|
|
|
// i.link_table_name
|
|
|
|
|
// ) {
|
|
|
|
|
// index({
|
|
|
|
|
// page: 1,
|
|
|
|
|
// page_size: 999,
|
|
|
|
|
// table_name: i.link_table_name,
|
|
|
|
|
// }).then((res) => {
|
|
|
|
|
// i._paramters = res.data ?? [];
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// this.form = res.fields
|
|
|
|
|
this.table = this.form
|
|
|
|
|
?.filter((i) => i.list_show)
|
|
|
|
|
.map((i) => {
|
|
|
|
|
@ -562,7 +566,10 @@ export default {
|
|
|
|
|
? this.form.find((i) => i.field === field)._params
|
|
|
|
|
: [];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//TODO:业务特殊处理
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getFormDetail();
|
|
|
|
|
|