|
@@ -10,7 +10,7 @@
|
|
>
|
|
>
|
|
<div class="app-containers">
|
|
<div class="app-containers">
|
|
<DataTable
|
|
<DataTable
|
|
- :tableHeader="state.list"
|
|
|
|
|
|
+ :tableHeader="tableCols"
|
|
:tableData="tableData"
|
|
:tableData="tableData"
|
|
:tableBtnGroup="tableBtnGroup"
|
|
:tableBtnGroup="tableBtnGroup"
|
|
:tableProperty="{ rowKey: 'ID' }"
|
|
:tableProperty="{ rowKey: 'ID' }"
|
|
@@ -24,19 +24,24 @@
|
|
:msgTitle="msgTitle"
|
|
:msgTitle="msgTitle"
|
|
@resetForm="resetForm"
|
|
@resetForm="resetForm"
|
|
@delRest="delRest"
|
|
@delRest="delRest"
|
|
|
|
+ @submitForm="submitForm"
|
|
|
|
+ @delRemove="delRemove"
|
|
>
|
|
>
|
|
<div class="diacont">
|
|
<div class="diacont">
|
|
<el-form :model="tableForm">
|
|
<el-form :model="tableForm">
|
|
<el-row :gutter="24">
|
|
<el-row :gutter="24">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="名称" size="default">
|
|
<el-form-item label="名称" size="default">
|
|
- <el-input v-model="tableForm.name" placeholder="请输入名称" />
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="tableForm.columnName"
|
|
|
|
+ placeholder="请输入名称"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="标签" size="default">
|
|
<el-form-item label="标签" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.china"
|
|
|
|
|
|
+ v-model="tableForm.columnLabel"
|
|
placeholder="请输入标签"
|
|
placeholder="请输入标签"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -45,7 +50,7 @@
|
|
<el-form-item label="描述" size="default">
|
|
<el-form-item label="描述" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.englin"
|
|
|
|
|
|
+ v-model="tableForm.columnDescribe"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -66,7 +71,7 @@
|
|
<el-form-item label="排序" size="default">
|
|
<el-form-item label="排序" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.two"
|
|
|
|
|
|
+ v-model="tableForm.needSort"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -87,7 +92,7 @@
|
|
<el-form-item label="过滤" size="default">
|
|
<el-form-item label="过滤" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.three"
|
|
|
|
|
|
+ v-model="tableForm.needFilters"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -108,7 +113,7 @@
|
|
<el-form-item label="显示" size="default">
|
|
<el-form-item label="显示" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text"
|
|
|
|
|
|
+ v-model="tableForm.needShow"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -129,7 +134,7 @@
|
|
<el-form-item label="数据类型" size="default">
|
|
<el-form-item label="数据类型" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text1"
|
|
|
|
|
|
+ v-model="tableForm.dataType"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -150,7 +155,7 @@
|
|
<el-form-item label="分组" size="default">
|
|
<el-form-item label="分组" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text2"
|
|
|
|
|
|
+ v-model="tableForm.needGroup"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -171,7 +176,7 @@
|
|
<el-form-item label="下拉" size="default">
|
|
<el-form-item label="下拉" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text3"
|
|
|
|
|
|
+ v-model="tableForm.listqueryTemplateID"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -192,7 +197,7 @@
|
|
<el-form-item label="合计" size="default">
|
|
<el-form-item label="合计" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text4"
|
|
|
|
|
|
+ v-model="tableForm.needCount"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -213,7 +218,7 @@
|
|
<el-form-item label="字段排序" size="default">
|
|
<el-form-item label="字段排序" size="default">
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text5"
|
|
|
|
|
|
+ v-model="tableForm.orderNumber"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -241,66 +246,40 @@
|
|
import DataTable from "@/components/tableTemp/index.vue";
|
|
import DataTable from "@/components/tableTemp/index.vue";
|
|
import Minheader from "@/components/minheader/index.vue";
|
|
import Minheader from "@/components/minheader/index.vue";
|
|
import Dialog from "@/components/dialog/index.vue";
|
|
import Dialog from "@/components/dialog/index.vue";
|
|
|
|
+import { Query, GeneralDataReception } from "@/api/webApi";
|
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
+const route = useRoute();
|
|
|
|
+const page = ref<number>(0); //分页参数
|
|
|
|
+const dataContent = ref<object>({});
|
|
|
|
+const noMore = ref<Boolean>(false);
|
|
|
|
+const rowTitle = ref<String>("");
|
|
|
|
+const tableCols = ref([]); //表头数据
|
|
|
|
+const serviceId = ref<String>("");
|
|
|
|
+const tableObj = ref({}); //增删改数据缓存
|
|
const flag = ref<Boolean>(false); //弹窗开关
|
|
const flag = ref<Boolean>(false); //弹窗开关
|
|
const type = ref<String>(""); //判断是否删除
|
|
const type = ref<String>(""); //判断是否删除
|
|
const msgTitle = ref<String>("新增查询项"); //弹窗标题
|
|
const msgTitle = ref<String>("新增查询项"); //弹窗标题
|
|
const tableColsCopys = reactive<Object>({}); //弹窗
|
|
const tableColsCopys = reactive<Object>({}); //弹窗
|
|
const tableOptionser = ref<Array>([]); //弹窗下拉
|
|
const tableOptionser = ref<Array>([]); //弹窗下拉
|
|
const tableForm = reactive({
|
|
const tableForm = reactive({
|
|
- name: "",
|
|
|
|
- china: "",
|
|
|
|
- englin: "",
|
|
|
|
- two: "",
|
|
|
|
- three: "",
|
|
|
|
- text: "",
|
|
|
|
- text1: "",
|
|
|
|
- text2: "",
|
|
|
|
- text3: "",
|
|
|
|
- text4: "",
|
|
|
|
- text5: "",
|
|
|
|
|
|
+ queryTemplateColumnSetID: "",
|
|
|
|
+ queryTemplateID: route.query.queryTemplateID,
|
|
|
|
+ columnName: "",
|
|
|
|
+ columnLabel: "",
|
|
|
|
+ columnDescribe: "",
|
|
|
|
+ needSort: "",
|
|
|
|
+ needFilters: "",
|
|
|
|
+ needShow: "",
|
|
|
|
+ needGroup: "",
|
|
|
|
+ dataType: "",
|
|
|
|
+ listqueryTemplateID: "",
|
|
|
|
+ needCount: "",
|
|
|
|
+ orderNumber: "",
|
|
|
|
+ needSearch: "",
|
|
|
|
+ event: "",
|
|
}); //弹窗内容
|
|
}); //弹窗内容
|
|
//列表
|
|
//列表
|
|
-const tableData = ref([
|
|
|
|
- {
|
|
|
|
- name: "测试",
|
|
|
|
- china: "测试",
|
|
|
|
- englin: "测试",
|
|
|
|
- two: "测试",
|
|
|
|
- three: "测试",
|
|
|
|
- text: "测试",
|
|
|
|
- text1: "测试",
|
|
|
|
- text2: "测试",
|
|
|
|
- text3: "测试",
|
|
|
|
- text4: "测试",
|
|
|
|
- text5: "测试",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "测试",
|
|
|
|
- china: "测试",
|
|
|
|
- englin: "测试",
|
|
|
|
- two: "测试",
|
|
|
|
- three: "测试",
|
|
|
|
- text: "测试",
|
|
|
|
- text1: "测试",
|
|
|
|
- text2: "测试",
|
|
|
|
- text3: "测试",
|
|
|
|
- text4: "测试",
|
|
|
|
- text5: "测试",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "测试",
|
|
|
|
- china: "测试",
|
|
|
|
- englin: "测试",
|
|
|
|
- two: "测试",
|
|
|
|
- three: "测试",
|
|
|
|
- text: "测试",
|
|
|
|
- text1: "测试",
|
|
|
|
- text2: "测试",
|
|
|
|
- text3: "测试",
|
|
|
|
- text4: "测试",
|
|
|
|
- text5: "测试",
|
|
|
|
- },
|
|
|
|
-]);
|
|
|
|
|
|
+const tableData = ref([]);
|
|
//表头
|
|
//表头
|
|
const state = reactive({
|
|
const state = reactive({
|
|
list: [
|
|
list: [
|
|
@@ -334,22 +313,25 @@ const tableBtnGroup = ref([
|
|
const addForm = () => {
|
|
const addForm = () => {
|
|
msgTitle.value = "新增查询项";
|
|
msgTitle.value = "新增查询项";
|
|
flag.value = true;
|
|
flag.value = true;
|
|
|
|
+ tableForm.event = 1;
|
|
type.value = "";
|
|
type.value = "";
|
|
};
|
|
};
|
|
//取消
|
|
//取消
|
|
const resetForm = () => {
|
|
const resetForm = () => {
|
|
flag.value = false;
|
|
flag.value = false;
|
|
- tableForm.name = "";
|
|
|
|
- tableForm.china = "";
|
|
|
|
- tableForm.englin = "";
|
|
|
|
- tableForm.two = "";
|
|
|
|
- tableForm.three = "";
|
|
|
|
- tableForm.text = "";
|
|
|
|
- tableForm.text1 = "";
|
|
|
|
- tableForm.text2 = "";
|
|
|
|
- tableForm.text3 = "";
|
|
|
|
- tableForm.text4 = "";
|
|
|
|
- tableForm.text5 = "";
|
|
|
|
|
|
+ tableForm.queryTemplateColumnSetID = "";
|
|
|
|
+ tableForm.columnName = "";
|
|
|
|
+ tableForm.columnLabel = "";
|
|
|
|
+ tableForm.columnDescribe = "";
|
|
|
|
+ tableForm.needSort = "";
|
|
|
|
+ tableForm.needFilters = "";
|
|
|
|
+ tableForm.needShow = "";
|
|
|
|
+ tableForm.needGroup = "";
|
|
|
|
+ tableForm.dataType = "";
|
|
|
|
+ tableForm.listqueryTemplateID = "";
|
|
|
|
+ tableForm.needCount = "";
|
|
|
|
+ tableForm.orderNumber = "";
|
|
|
|
+ tableForm.needSearch = "";
|
|
};
|
|
};
|
|
//编辑
|
|
//编辑
|
|
// const editDialog = (data) => {
|
|
// const editDialog = (data) => {
|
|
@@ -369,21 +351,38 @@ const btnClick = (row, index, param) => {
|
|
msgTitle.value = "编辑查询项";
|
|
msgTitle.value = "编辑查询项";
|
|
flag.value = true;
|
|
flag.value = true;
|
|
type.value = "";
|
|
type.value = "";
|
|
- tableForm.name = index.name;
|
|
|
|
- tableForm.china = index.china;
|
|
|
|
- tableForm.englin = index.englin;
|
|
|
|
- tableForm.two = index.two;
|
|
|
|
- tableForm.three = index.three;
|
|
|
|
- tableForm.text = index.text;
|
|
|
|
- tableForm.text1 = index.text1;
|
|
|
|
- tableForm.text2 = index.text2;
|
|
|
|
- tableForm.text3 = index.text3;
|
|
|
|
- tableForm.text4 = index.text4;
|
|
|
|
- tableForm.text5 = index.text5;
|
|
|
|
|
|
+ tableForm.event = 2;
|
|
|
|
+ tableForm.queryTemplateColumnSetID = index.queryTemplateColumnSetID;
|
|
|
|
+ tableForm.columnName = index.columnName;
|
|
|
|
+ tableForm.columnLabel = index.columnLabel;
|
|
|
|
+ tableForm.columnDescribe = index.columnDescribe;
|
|
|
|
+ tableForm.needSort = index.needSort;
|
|
|
|
+ tableForm.needFilters = index.needFilters;
|
|
|
|
+ tableForm.needShow = index.needShow;
|
|
|
|
+ tableForm.needGroup = index.needGroup;
|
|
|
|
+ tableForm.dataType = index.dataType;
|
|
|
|
+ tableForm.listqueryTemplateID = index.listqueryTemplateID;
|
|
|
|
+ tableForm.needCount = index.needCount;
|
|
|
|
+ tableForm.orderNumber = index.orderNumber;
|
|
|
|
+ tableForm.needSearch = index.needSearch;
|
|
} else if (param === 3) {
|
|
} else if (param === 3) {
|
|
msgTitle.value = "删除查询项";
|
|
msgTitle.value = "删除查询项";
|
|
flag.value = true;
|
|
flag.value = true;
|
|
type.value = "del";
|
|
type.value = "del";
|
|
|
|
+ tableForm.event = 3;
|
|
|
|
+ tableForm.queryTemplateColumnSetID = index.queryTemplateColumnSetID;
|
|
|
|
+ tableForm.columnName = index.columnName;
|
|
|
|
+ tableForm.columnLabel = index.columnLabel;
|
|
|
|
+ tableForm.columnDescribe = index.columnDescribe;
|
|
|
|
+ tableForm.needSort = index.needSort;
|
|
|
|
+ tableForm.needFilters = index.needFilters;
|
|
|
|
+ tableForm.needShow = index.needShow;
|
|
|
|
+ tableForm.needGroup = index.needGroup;
|
|
|
|
+ tableForm.dataType = index.dataType;
|
|
|
|
+ tableForm.listqueryTemplateID = index.listqueryTemplateID;
|
|
|
|
+ tableForm.needCount = index.needCount;
|
|
|
|
+ tableForm.orderNumber = index.orderNumber;
|
|
|
|
+ tableForm.needSearch = index.needSearch;
|
|
} else if (param === 4) {
|
|
} else if (param === 4) {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -393,10 +392,99 @@ const eleDialog = () => {
|
|
flag.value = true;
|
|
flag.value = true;
|
|
type.value = "del";
|
|
type.value = "del";
|
|
};
|
|
};
|
|
|
|
+const delRemove = () => {
|
|
|
|
+ tableForm.event = 3;
|
|
|
|
+ generalDataReception(tableForm);
|
|
|
|
+};
|
|
//删除
|
|
//删除
|
|
const delRest = () => {
|
|
const delRest = () => {
|
|
flag.value = false;
|
|
flag.value = false;
|
|
};
|
|
};
|
|
|
|
+//获取表格数据
|
|
|
|
+const getQuery = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const { code, returnData } = await Query({
|
|
|
|
+ id: DATACONTENT_ID.sysQueryChildTabId,
|
|
|
|
+ needPage: ++page.value,
|
|
|
|
+ dataContent: [route.query.queryTemplateID],
|
|
|
|
+ });
|
|
|
|
+ if (code === "0") {
|
|
|
|
+ if (returnData.listValues.length === 0) {
|
|
|
|
+ page.value--;
|
|
|
|
+ noMore.value = true;
|
|
|
|
+ }
|
|
|
|
+ const titleColumn = returnData.columnSet.find(
|
|
|
|
+ (item) => item.needShow === 1
|
|
|
|
+ );
|
|
|
|
+ if (titleColumn) {
|
|
|
|
+ rowTitle.value = titleColumn.columnName;
|
|
|
|
+ }
|
|
|
|
+ tableData.value.push(...returnData.listValues);
|
|
|
|
+ tableCols.value = returnData.columnSet;
|
|
|
|
+ tableCols.value.forEach((element) => {
|
|
|
|
+ element.label = element.columnLabel;
|
|
|
|
+ element.key = element.columnName;
|
|
|
|
+ // if (element.columnName === "queryTemplate") {
|
|
|
|
+ // element.width = "300px";
|
|
|
|
+ // }
|
|
|
|
+ });
|
|
|
|
+ serviceId.value = returnData.submitID;
|
|
|
|
+ } else {
|
|
|
|
+ page.value--;
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ page.value--;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+//确认提交
|
|
|
|
+const submitForm = () => {
|
|
|
|
+ generalDataReception(tableForm);
|
|
|
|
+};
|
|
|
|
+const resetTable = () => {
|
|
|
|
+ page.value = 0;
|
|
|
|
+ noMore.value = false;
|
|
|
|
+ tableData.value = [];
|
|
|
|
+};
|
|
|
|
+//新增-编辑-删除
|
|
|
|
+const generalDataReception = async (data) => {
|
|
|
|
+ try {
|
|
|
|
+ let obj = {
|
|
|
|
+ IATACode: route.query.IATACode,
|
|
|
|
+ };
|
|
|
|
+ data = {
|
|
|
|
+ ...data,
|
|
|
|
+ ...obj,
|
|
|
|
+ };
|
|
|
|
+ const { code } = await GeneralDataReception({
|
|
|
|
+ serviceId: serviceId.value,
|
|
|
|
+ dataContent: JSON.stringify(data),
|
|
|
|
+ });
|
|
|
|
+ if (code == 0) {
|
|
|
|
+ ElMessage.success(`操作成功`);
|
|
|
|
+ // this.$message.success("操作成功");
|
|
|
|
+ resetTable();
|
|
|
|
+ getQuery();
|
|
|
|
+ resetForm();
|
|
|
|
+ flag.value = false;
|
|
|
|
+ // rmFlag.value = false;
|
|
|
|
+ tableObj.value = {};
|
|
|
|
+ // this.$router.go(0);
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(`操作失败`);
|
|
|
|
+ // this.$message.error("操作失败");
|
|
|
|
+ // this.flag = false;
|
|
|
|
+ // this.rmFlag = false;
|
|
|
|
+ tableObj.value = {};
|
|
|
|
+ resetForm();
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ flag.value = false;
|
|
|
|
+ // rmFlag.value = false;
|
|
|
|
+ tableObj.value = {};
|
|
|
|
+ resetForm();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+getQuery();
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
::v-deep .el-form-item__label {
|
|
::v-deep .el-form-item__label {
|