Commit 2f9645df authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents bbf87148 0238fa63
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<a-button type="primary" @click="handleAdd">新增</a-button> <a-button type="primary" @click="handleAdd">新增</a-button>
<a-button type="danger" @click="handleDelAll">批量删除</a-button> <a-button type="danger" @click="handleDelAll">批量删除</a-button>
</a-space> </a-space>
<div class="search-box"> <div class="search-box" v-if="searchTemplate.length">
<a-input-group compact> <a-input-group compact>
<a-select style="min-width: 100px" v-model="fieldCode"> <a-select style="min-width: 100px" v-model="fieldCode">
<a-select-option <a-select-option
v-for="v in appTemplate" v-for="v in searchTemplate"
:key="v.id" :key="v.id"
:value="v.fieldCode" :value="v.fieldCode"
> >
...@@ -153,7 +153,9 @@ export default { ...@@ -153,7 +153,9 @@ export default {
previewVisible: false, previewVisible: false,
previewData: {}, // 预览信息 previewData: {}, // 预览信息
appTemplate: [], // 字段模板列表 appTemplate: [], // 字段模板列表
searchTemplate: [], //关联搜索字段模板列表
selectedRowKeys: [], selectedRowKeys: [],
orConditionList: [],
}; };
}, },
computed: { computed: {
...@@ -190,14 +192,25 @@ export default { ...@@ -190,14 +192,25 @@ export default {
return { return {
title: v.fieldName, title: v.fieldName,
dataIndex: v.fieldCode, dataIndex: v.fieldCode,
customRender: (text, record) => {
let row = record.appInfoFieldList.find(
(item) => item.fieldCode == v.fieldCode
);
if (row.fieldTypeValue && !row.serviceApiParams) {
let fieldTypeValue = JSON.parse(row.fieldTypeValue);
return fieldTypeValue[text];
} else {
return text;
}
},
}; };
} }
}); });
return [index, ...arr, action]; return [index, ...arr, action];
}, },
}, },
created() { async created() {
this.getTempleteList(); await this.getTempleteList();
this.getDatasetList(); this.getDatasetList();
}, },
methods: { methods: {
...@@ -210,11 +223,15 @@ export default { ...@@ -210,11 +223,15 @@ export default {
}); });
if (res.data.code === 1) { if (res.data.code === 1) {
let { data } = res.data.data; let { data } = res.data.data;
this.appTemplate = data.sort((a, b) => { let arr = data.sort((a, b) => {
return a.fieldOrderNo - b.fieldOrderNo; return a.fieldOrderNo - b.fieldOrderNo;
}); });
if (this.appTemplate.length) { this.appTemplate = arr;
this.fieldCode = this.appTemplate[0].fieldCode; this.searchTemplate = data.filter((v) => {
return v.defaultValue == 1;
});
if (this.searchTemplate.length) {
this.fieldCode = this.searchTemplate[0].fieldCode;
} }
} }
}, },
...@@ -227,6 +244,16 @@ export default { ...@@ -227,6 +244,16 @@ export default {
appId: this.appId, appId: this.appId,
fieldCode: this.fieldCode, fieldCode: this.fieldCode,
fieldValue: `%${this.searchVal}%`, fieldValue: `%${this.searchVal}%`,
// orConditionList: [
// {
// fieldCode: this.fieldCode,
// fieldValue: `%${this.searchVal}%`,
// },
// {
// fieldCode: "top",
// fieldValue: `%%`,
// },
// ],
}); });
this.loading = false; this.loading = false;
if (res.data.code === 1) { if (res.data.code === 1) {
......
...@@ -120,6 +120,18 @@ export default { ...@@ -120,6 +120,18 @@ export default {
title: "允许为空", title: "允许为空",
scopedSlots: { customRender: "fieldNull" }, scopedSlots: { customRender: "fieldNull" },
}, },
{
title: "关联搜索",
dataIndex: "defaultValue",
customRender: (text) => {
return <a-tag> {text == 1 ? "" : ""} </a-tag>;
},
},
{
title: "默认值",
dataIndex: "fieldValue",
},
{ {
title: "操作", title: "操作",
width: "110px", width: "110px",
...@@ -239,5 +251,4 @@ export default { ...@@ -239,5 +251,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -363,7 +363,7 @@ export default { ...@@ -363,7 +363,7 @@ export default {
if (v.id) { if (v.id) {
delete v.id; delete v.id;
} }
v.fieldValue = undefined; // v.fieldValue = v.fieldValue ?? undefined;
if (v.fieldType == "upload") { if (v.fieldType == "upload") {
v.fileList = []; v.fileList = [];
} }
...@@ -396,30 +396,32 @@ export default { ...@@ -396,30 +396,32 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
data.appInfoFieldList.forEach((v) => { setTimeout(() => {
if (v.fieldType == "upload") { data.appInfoFieldList.forEach((v) => {
if (v.fieldValue) { if (v.fieldType == "upload") {
let arr = v.fieldValue.split(","); if (v.fieldValue) {
v.fileList = arr.map((v, i) => { let arr = v.fieldValue.split(",");
return { v.fileList = arr.map((v, i) => {
uid: i, return {
name: v, uid: i,
status: "done", name: v,
url: v, status: "done",
}; url: v,
}); };
} else { });
v.fileList = []; } else {
} v.fileList = [];
} else if (v.fieldType == "checkbox") { }
if (v.fieldValue) { } else if (v.fieldType == "checkbox") {
v.checkbox = v.fieldValue.split(","); if (v.fieldValue) {
} else { v.checkbox = v.fieldValue.split(",");
v.checkbox = []; } else {
v.checkbox = [];
}
} }
} });
}); this.form = { ...data };
this.form = { ...data }; }, 10);
}, },
// 更改文件名称 // 更改文件名称
......
...@@ -137,6 +137,15 @@ ...@@ -137,6 +137,15 @@
<a-radio :value="1"></a-radio> <a-radio :value="1"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="关联搜索" prop="defaultValue">
<a-radio-group v-model="form.defaultValue">
<a-radio value="0"></a-radio>
<a-radio value="1"></a-radio>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="默认值" prop="fieldValue">
<a-input v-model="form.fieldValue" placeholder="请输入默认值" />
</a-form-model-item>
<a-form-model-item label="排序" prop="fieldOrderNo"> <a-form-model-item label="排序" prop="fieldOrderNo">
<a-input-number v-model="form.fieldOrderNo" :min="0" /> <a-input-number v-model="form.fieldOrderNo" :min="0" />
</a-form-model-item> </a-form-model-item>
...@@ -245,7 +254,8 @@ export default { ...@@ -245,7 +254,8 @@ export default {
isList: 0, //字段是否列表显示(0.否,1.是) isList: 0, //字段是否列表显示(0.否,1.是)
fieldOrderNo: 99, // 排序号 fieldOrderNo: 99, // 排序号
fieldTypeValue: "", // 字段类型值 fieldTypeValue: "", // 字段类型值
defaultValue: "", // 字段默认值 defaultValue: "0", // 字段默认值(用作关联搜索)
fieldValue: "", // 字段值
serviceApi: "", // 动态数据接口 serviceApi: "", // 动态数据接口
serviceApiParams: "", // 动态数据参数配置 serviceApiParams: "", // 动态数据参数配置
remark: "", // remark: "", //
......
...@@ -181,6 +181,7 @@ export default { ...@@ -181,6 +181,7 @@ export default {
// 确定 // 确定
handleOk() { handleOk() {
this.$refs.formData.validate(async (valid) => { this.$refs.formData.validate(async (valid) => {
console.log(this.form.parentId);
if (valid) { if (valid) {
this.confirmLoading = true; this.confirmLoading = true;
let res = await saveBusiness({ let res = await saveBusiness({
...@@ -190,8 +191,9 @@ export default { ...@@ -190,8 +191,9 @@ export default {
let { code, msg, data } = res.data; let { code, msg, data } = res.data;
if (code === 1) { if (code === 1) {
if (!this.form.id) { if (!this.form.id) {
let businessId = data.id ? data.id : data.entity.id;
let result = await addInBusiness({ let result = await addInBusiness({
businessIds: String(data.entity.id), businessIds: String(businessId),
siteId: this.siteId, siteId: this.siteId,
}); });
if (result.data.code === 1) { if (result.data.code === 1) {
......
...@@ -156,6 +156,10 @@ export default { ...@@ -156,6 +156,10 @@ export default {
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getDimensionList();
}
this.tableData = data; this.tableData = data;
this.total = total; this.total = total;
this.dict = dict; this.dict = dict;
......
...@@ -213,6 +213,7 @@ export default { ...@@ -213,6 +213,7 @@ export default {
this.dict = dict; this.dict = dict;
if (!data.length && this.current > 1) { if (!data.length && this.current > 1) {
this.current -= 1; this.current -= 1;
this.getSystemParameterList();
} }
this.total = total; this.total = total;
this.tableData = data; this.tableData = data;
......
...@@ -166,6 +166,10 @@ export default { ...@@ -166,6 +166,10 @@ export default {
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getResourceList();
}
this.tableData = data; this.tableData = data;
this.total = total; this.total = total;
this.dict = dict; this.dict = dict;
......
...@@ -141,6 +141,10 @@ export default { ...@@ -141,6 +141,10 @@ export default {
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total } = res.data.data; let { data, total } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getRoleList();
}
this.tableData = data; this.tableData = data;
this.total = total; this.total = total;
} }
......
...@@ -177,6 +177,10 @@ export default { ...@@ -177,6 +177,10 @@ export default {
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getUserList();
}
let { name } = this.userInfo; let { name } = this.userInfo;
if (this.loginNames.includes(name)) { if (this.loginNames.includes(name)) {
this.tableData = data; this.tableData = data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment