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

Merge remote-tracking branch 'origin/master'

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