Commit 390070b5 authored by “yiyousong”'s avatar “yiyousong”

feat: 添加应用配置

parent c033d8e4
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
this.getDeviceInfo(); this.getDeviceInfo();
if (newVal == "/" || newVal == "/home") { if (newVal == "/" || newVal == "/home") {
this.getHomeInfo(); this.getHomeInfo();
// this.getSetinfo(); this.getSetinfo();
this.getAppList(); this.getAppList();
} }
}, },
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
"SET_deviceCode", "SET_deviceCode",
"SET_appList", "SET_appList",
"SET_onlineSkin", "SET_onlineSkin",
"SET_showApp",
]), ]),
// 简析url // 简析url
urlGet() { urlGet() {
...@@ -153,9 +154,9 @@ export default { ...@@ -153,9 +154,9 @@ export default {
// [...data.hotDatumList, ...data.datumList], // [...data.hotDatumList, ...data.datumList],
// "id" // "id"
// ).slice(0, 7); // ).slice(0, 7);
datumList = data.hotDatumList.slice(0, 7); datumList = data.hotDatumList.slice(0, 5);
} else { } else {
datumList = data.datumList.slice(0, 7); datumList = data.datumList.slice(0, 5);
} }
if (data.hotMatterList) { if (data.hotMatterList) {
// matterList = this.removeDuplication( // matterList = this.removeDuplication(
...@@ -207,6 +208,7 @@ export default { ...@@ -207,6 +208,7 @@ export default {
let res = await getDeviceInfo(); let res = await getDeviceInfo();
if (res.data.code == 1) { if (res.data.code == 1) {
let { data } = res.data; let { data } = res.data;
this.SET_showApp(!!data.source);
this.enabled = data.enabled; this.enabled = data.enabled;
} }
}, },
......
...@@ -208,8 +208,10 @@ export default { ...@@ -208,8 +208,10 @@ export default {
setTimeout(() => { setTimeout(() => {
// 查询站点信息 // 查询站点信息
this.getHomeInfo(); this.getHomeInfo();
// 查询设备信息
this.getDeviceInfo();
// 查询皮肤 // 查询皮肤
// this.getSetinfo(); this.getSetinfo();
// 查询应用列表 // 查询应用列表
this.getAppList(); this.getAppList();
}); });
......
...@@ -51,9 +51,11 @@ export default { ...@@ -51,9 +51,11 @@ export default {
appId, appId,
newsSource, newsSource,
devicenum, devicenum,
// appName, appName,
} = this.$route.query; } = this.$route.query;
this.iframeUrl = `${custUrl}?siteId=${siteId}&baseUrl=${serviceApi}&appId=${appId}&newsSource=${newsSource}&devicenum=${devicenum}`; this.iframeUrl = `${custUrl}?siteId=${siteId}&baseUrl=${serviceApi}&appId=${appId}&newsSource=${newsSource}&devicenum=${devicenum}&appName=${encodeURIComponent(
appName
)}`;
}, },
changeLoading() { changeLoading() {
this.loading = false; this.loading = false;
......
...@@ -150,21 +150,30 @@ ...@@ -150,21 +150,30 @@
<div v-else class="tac empty-text">暂无数据</div> <div v-else class="tac empty-text">暂无数据</div>
</div> </div>
</div> </div>
<div class="app-list"> <div class="app-box" v-if="showApp && appList && appList.length">
<div <div class="app-list">
class="app-item" <div
v-for="v in appList" class="app-item"
:key="v.id" v-for="v in appList"
@click="clickApp(v)" :key="v.id"
> v-onEvent="{
<img eventName: '点击',
:src=" eventCode: 'Click',
v.appIconPath.charAt(0) == '/' businessCode: v.appCode,
? v.appIconPath businessName: v.appName,
: '/' + v.appIconPath routers: $route,
" }"
/> @click="clickApp(v)"
<span class="app-name">{{ v.appName }}</span> >
<img
:src="
v.appIconPath.charAt(0) == '/'
? v.appIconPath
: '/' + v.appIconPath
"
/>
<span class="app-name">{{ v.appName }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -295,7 +304,7 @@ export default { ...@@ -295,7 +304,7 @@ export default {
waitTime: 2500, // 单行停顿时间(singleHeight,waitTime) waitTime: 2500, // 单行停顿时间(singleHeight,waitTime)
}; };
}, },
...mapState(["homeInfo", "datumList", "matterList", "appList"]), ...mapState(["homeInfo", "datumList", "matterList", "appList", "showApp"]),
}, },
created() { created() {
// this.getHomeInfo(); // this.getHomeInfo();
...@@ -485,7 +494,7 @@ export default { ...@@ -485,7 +494,7 @@ export default {
} }
.home { .home {
width: 100%; width: 100%;
height: auto; height: 100%;
padding-top: 40px; padding-top: 40px;
background-size: 100% 100%; background-size: 100% 100%;
} }
...@@ -651,13 +660,20 @@ export default { ...@@ -651,13 +660,20 @@ export default {
} }
} }
} }
.app-list { .app-box {
width: 100%; width: 100%;
height: 124px; height: 124px;
padding: 20px; padding: 0px 20px;
}
.app-list {
width: 100%;
height: 100%;
padding: 0px 20px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 46px; gap: 46px;
background-color: #fff;
border-radius: 8px;
overflow: hidden; overflow: hidden;
.app-item { .app-item {
display: flex; display: flex;
......
...@@ -15,6 +15,7 @@ export default new Vuex.Store({ ...@@ -15,6 +15,7 @@ export default new Vuex.Store({
times: 0, // 倒计时时间 times: 0, // 倒计时时间
operTime: "", // 样表打开时间 operTime: "", // 样表打开时间
appList: [], // 应用列表 appList: [], // 应用列表
showApp: false, // 是否展示应用
onlineSkin: "", // 皮肤地址 onlineSkin: "", // 皮肤地址
}, },
getters: { getters: {
...@@ -29,6 +30,9 @@ export default new Vuex.Store({ ...@@ -29,6 +30,9 @@ export default new Vuex.Store({
}, },
}, },
mutations: { mutations: {
SET_showApp(state, showApp) {
state.showApp = showApp;
},
SET_onlineSkin(state, onlineSkin) { SET_onlineSkin(state, onlineSkin) {
state.onlineSkin = onlineSkin; state.onlineSkin = onlineSkin;
}, },
......
...@@ -136,13 +136,27 @@ ...@@ -136,13 +136,27 @@
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
v-model="scope.row.enabled" v-model="scope.row.enabled"
@change="handleChange(scope.row)" @change="handleChange(scope.row, 1)"
inactive-text="停用" inactive-text="停用"
active-text="启用" active-text="启用"
> >
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="source" label="展示应用">
<template slot-scope="scope">
<el-switch
class="tableScopeSwitch"
:active-value="1"
:inactive-value="0"
v-model="scope.row.source"
@change="handleChange(scope.row, 2)"
inactive-text=""
active-text=""
>
</el-switch>
</template>
</el-table-column>
<el-table-column align="center" prop="deviceRemark" label="备注"> <el-table-column align="center" prop="deviceRemark" label="备注">
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="200"> <el-table-column align="center" label="操作" width="200">
...@@ -207,6 +221,7 @@ import { ...@@ -207,6 +221,7 @@ import {
saveDeviceEnable, saveDeviceEnable,
saveDeviceActive, saveDeviceActive,
delDevice, delDevice,
saveDevice,
} from "@/api/device"; } from "@/api/device";
import local from "@/utils/local"; import local from "@/utils/local";
const typeList = { const typeList = {
...@@ -346,13 +361,38 @@ export default { ...@@ -346,13 +361,38 @@ export default {
console.log("取消成功!"); console.log("取消成功!");
}); });
}, },
// 启停用 // 启停用\展示应用
async handleChange(row) { async handleChange(row, type) {
let obj = { this.loading = true;
id: row.id, let obj = {};
enabled: row.enabled, if (type === 1) {
}; obj = {
let res = await saveDeviceEnable(obj); id: row.id,
enabled: row.enabled,
};
this.handleUpdate(obj);
} else {
obj = {
id: row.id,
source: row.source,
};
this.handleUpdateDevice(obj);
}
},
// 修改设备起停用
async handleUpdate(row) {
let res = await saveDeviceEnable(row);
this.loading = false;
let { code } = res.data;
if (code == 1) {
this.$message.success("修改成功");
this.getDeviceList();
}
},
// 更新设备
async handleUpdateDevice(row) {
let res = await saveDevice(row);
this.loading = false;
let { code } = res.data; let { code } = res.data;
if (code == 1) { if (code == 1) {
this.$message.success("修改成功"); this.$message.success("修改成功");
......
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