Commit 4d2c0405 authored by “yiyousong”'s avatar “yiyousong”

pref:修改新增应用

parent 7560dca7
...@@ -53,6 +53,10 @@ ...@@ -53,6 +53,10 @@
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
<!-- 主题类型 -->
<template slot="appThemeName" slot-scope="text">
{{ filterItems(text.appThemeName, dict.appThemeName) }}
</template>
<!-- 简介 --> <!-- 简介 -->
<template slot="summary" slot-scope="text"> <template slot="summary" slot-scope="text">
<span :title="text.summary">{{ <span :title="text.summary">{{
...@@ -94,6 +98,7 @@ ...@@ -94,6 +98,7 @@
<!-- 新增应用 --> <!-- 新增应用 -->
<AddApp <AddApp
ref="AddApp" ref="AddApp"
:dict="dict"
@success="getAppList" @success="getAppList"
:AddVisible.sync="AddVisible" :AddVisible.sync="AddVisible"
:title="title" :title="title"
...@@ -138,7 +143,7 @@ const columns = [ ...@@ -138,7 +143,7 @@ const columns = [
{ {
title: "应用主题", title: "应用主题",
ellipsis: true, ellipsis: true,
dataIndex: "appThemeName", scopedSlots: { customRender: "appThemeName" },
}, },
{ {
title: "应用简介", title: "应用简介",
...@@ -186,6 +191,7 @@ export default { ...@@ -186,6 +191,7 @@ export default {
AddVisible: false, AddVisible: false,
title: "新增应用", title: "新增应用",
siteVisible: false, siteVisible: false,
dict: {}, // 字典
}; };
}, },
// 详情页返回不刷新数据 // 详情页返回不刷新数据
...@@ -210,7 +216,8 @@ export default { ...@@ -210,7 +216,8 @@ export default {
type: 2, type: 2,
}); });
this.loading = false; this.loading = false;
let { data, total } = res.data.data; let { data, total, dict } = res.data.data;
this.dict = dict;
if (res.data.code === 1) { if (res.data.code === 1) {
if (!data.length && this.current > 1) { if (!data.length && this.current > 1) {
this.current -= 1; this.current -= 1;
...@@ -328,6 +335,16 @@ export default { ...@@ -328,6 +335,16 @@ export default {
this.getAppList(); this.getAppList();
} }
}, },
// 过滤表格数据
filterItems(key, dict = {}) {
let val = "";
Object.keys(dict).forEach((keys) => {
if (key == keys) {
val = dict[keys];
}
});
return val;
},
}, },
}; };
</script> </script>
......
...@@ -53,6 +53,10 @@ ...@@ -53,6 +53,10 @@
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
<!-- 主题类型 -->
<template slot="appThemeName" slot-scope="text">
{{ filterItems(text.appThemeName, dict.appThemeName) }}
</template>
<!-- 简介 --> <!-- 简介 -->
<template slot="summary" slot-scope="text"> <template slot="summary" slot-scope="text">
<span :title="text.summary">{{ <span :title="text.summary">{{
...@@ -94,6 +98,7 @@ ...@@ -94,6 +98,7 @@
<!-- 新增应用 --> <!-- 新增应用 -->
<AddApp <AddApp
ref="AddApp" ref="AddApp"
:dict="dict"
@success="getAppList" @success="getAppList"
:AddVisible.sync="AddVisible" :AddVisible.sync="AddVisible"
:title="title" :title="title"
...@@ -138,7 +143,7 @@ const columns = [ ...@@ -138,7 +143,7 @@ const columns = [
{ {
title: "应用主题", title: "应用主题",
ellipsis: true, ellipsis: true,
dataIndex: "appThemeName", scopedSlots: { customRender: "appThemeName" },
}, },
{ {
title: "应用简介", title: "应用简介",
...@@ -186,6 +191,7 @@ export default { ...@@ -186,6 +191,7 @@ export default {
AddVisible: false, AddVisible: false,
title: "新增应用", title: "新增应用",
siteVisible: false, siteVisible: false,
dict: {}, // 字典
}; };
}, },
// 详情页返回不刷新数据 // 详情页返回不刷新数据
...@@ -210,7 +216,8 @@ export default { ...@@ -210,7 +216,8 @@ export default {
type: 1, type: 1,
}); });
this.loading = false; this.loading = false;
let { data, total } = res.data.data; let { data, total, dict } = res.data.data;
this.dict = dict;
if (res.data.code === 1) { if (res.data.code === 1) {
if (!data.length && this.current > 1) { if (!data.length && this.current > 1) {
this.current -= 1; this.current -= 1;
...@@ -328,6 +335,16 @@ export default { ...@@ -328,6 +335,16 @@ export default {
this.getAppList(); this.getAppList();
} }
}, },
// 过滤表格数据
filterItems(key, dict = {}) {
let val = "";
Object.keys(dict).forEach((keys) => {
if (key == keys) {
val = dict[keys];
}
});
return val;
},
}, },
}; };
</script> </script>
......
...@@ -22,11 +22,15 @@ ...@@ -22,11 +22,15 @@
<a-input v-model="form.appCode" placeholder="请输入应用编码" /> <a-input v-model="form.appCode" placeholder="请输入应用编码" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="应用主题" prop="appThemeName"> <a-form-model-item label="应用主题" prop="appThemeName">
<a-input v-model="form.appThemeName" placeholder="请输入应用主题" /> <a-select v-model="form.appThemeName" placeholder="请选择应用主题">
<!-- <a-select v-model="form.appThemeName" placeholder="请选择应用主题"> <a-select-option
<a-select-option value="shanghai"> Zone one </a-select-option> v-for="(v, key) in dict.appThemeName"
<a-select-option value="beijing"> Zone two </a-select-option> :value="key"
</a-select> --> :key="key"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="应用图标" prop="appIconPath"> <a-form-model-item label="应用图标" prop="appIconPath">
<a-upload <a-upload
...@@ -169,6 +173,13 @@ export default { ...@@ -169,6 +173,13 @@ export default {
required: true, required: true,
default: false, default: false,
}, },
dict: {
type: Object,
required: true,
default: () => {
return {};
},
},
}, },
data() { data() {
return { return {
...@@ -187,7 +198,7 @@ export default { ...@@ -187,7 +198,7 @@ export default {
appName: "", // 应用名称 appName: "", // 应用名称
appCode: "", // 应用编码 appCode: "", // 应用编码
appIconPath: "", // 应用图标 appIconPath: "", // 应用图标
appThemeName: "", // 应用主题名称 appThemeName: undefined, // 应用主题名称
type: "", // 类型(1.终端应用,2.移动端应用) type: "", // 类型(1.终端应用,2.移动端应用)
appType: 1, // 类型(1.应用程序,2.url) appType: 1, // 类型(1.应用程序,2.url)
shelves: 0, shelves: 0,
......
...@@ -182,11 +182,13 @@ export default { ...@@ -182,11 +182,13 @@ export default {
methods: { methods: {
// 获取参数列表 // 获取参数列表
async getSystemParameterList() { async getSystemParameterList() {
this.loading = true;
let res = await getSystemParameterList({ let res = await getSystemParameterList({
page: this.current, page: this.current,
size: this.size, size: this.size,
name: `%${this.searchValue}%`, name: `%${this.searchValue}%`,
}); });
this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { total, data, dict } = res.data.data; let { total, data, dict } = res.data.data;
this.dict = dict; this.dict = dict;
......
...@@ -112,8 +112,8 @@ export default { ...@@ -112,8 +112,8 @@ export default {
}); });
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { result, total } = res.data.data; let { data, total } = res.data.data;
this.tableData = result; this.tableData = data;
this.total = total; this.total = total;
} }
}, },
......
...@@ -169,16 +169,19 @@ export default { ...@@ -169,16 +169,19 @@ export default {
methods: { methods: {
// 获取参数列表 // 获取参数列表
async getSystemTaskList() { async getSystemTaskList() {
this.loading = true;
let res = await getSystemTaskList({ let res = await getSystemTaskList({
page: this.current, page: this.current,
size: this.size, size: this.size,
name: `%${this.searchValue}%`, name: `%${this.searchValue}%`,
}); });
this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
let { total, data, dict } = res.data.data; let { total, data, dict } = res.data.data;
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.getSystemTaskList();
} }
this.total = total; this.total = total;
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