Commit d820e240 authored by 姬鋆屾's avatar 姬鋆屾

Merge branch 'reg' of http://gitlab.scsmile.cn/zxf/smart_gov_platform into reg

parents 05c71723 dce97adc
......@@ -96,6 +96,12 @@
<span class="primary pointer" @click="handlePreview(text.id)"
>预览</span
>
<span
class="delete pointer"
v-permission="[1]"
@click="handleDel(text.id)"
>删除</span
>
</a-space>
</template>
</a-table>
......@@ -118,6 +124,7 @@ import {
usedVersion,
previewVersion,
getCategoryList,
deleteVersion,
} from "@/services/market";
import CheckSite from "../modal/CheckSite.vue";
import { pageSizeOptions } from "@/config/pageConfig.js";
......@@ -270,6 +277,33 @@ export default {
window.open(routeUrl.href, "_blank");
}
},
// 删除
handleDel(id) {
let _this = this;
_this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await deleteVersion({ id });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getVersions();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 翻页
handleChange(cur) {
this.current = cur;
......
......@@ -4,6 +4,12 @@
<a-space>
<a-button type="primary" @click="handleAdd"> 新增应用 </a-button>
<a-button type="primary" @click="handleClone"> 克隆 </a-button>
<a-button type="primary" @click="handleTheme">
批量关联应用主题
</a-button>
<a-button v-permission="[1]" type="danger" @click="handleDelAll">
批量删除
</a-button>
</a-space>
<a-input-search
style="width: 300px"
......@@ -67,7 +73,7 @@
</template>
<!-- 版本 -->
<template slot="version" slot-scope="text">
{{ text.version ? "v" + text.version : "--" }}
{{ text.version || text.version == 0 ? "v" + text.version : "--" }}
</template>
<!-- 类型 -->
<template slot="appType" slot-scope="text">
......@@ -91,7 +97,7 @@
>
<span
class="delete pointer"
:class="{ unDelete: text.distribute }"
:class="{ unDelete: userInfo.id != 1 && text.distribute }"
@click="handleDel(text.distribute, text.id)"
>删除</span
>
......@@ -114,22 +120,30 @@
:appList="selectedRowKeys"
:siteVisible.sync="siteVisible"
></CheckSite>
<!-- 批量修改应用主题 -->
<ChangeThem
:themVisible.sync="themVisible"
:themList="categoryList"
:appList="selectedAppList"
@edit="cloneSuccess"
></ChangeThem>
</div>
</template>
<script>
import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddApp from "../modal/AddApp.vue";
import CheckSite from "../modal/CheckSite.vue";
import ChangeThem from "../modal/ChangeThem.vue";
import {
getAppList,
deleteApp,
saveApp,
getCategoryList,
} from "@/services/market";
import { mapMutations } from "vuex";
import local from "@/utils/local";
import { mapMutations, mapGetters } from "vuex";
import { pageSizeOptions } from "@/config/pageConfig.js";
const columns = [
{
title: "序号",
......@@ -184,6 +198,7 @@ export default {
YSwitch,
AddApp,
CheckSite,
ChangeThem,
},
data() {
return {
......@@ -198,32 +213,21 @@ export default {
size: 10,
total: 0,
pageSizeOptions,
selectedRowKeys: [], // 表格勾选数据
selectedRowKeys: [], // 表格勾选id列表
selectedAppList: [], // 表格勾选信息列表
AddVisible: false,
title: "新增应用",
siteVisible: false,
themVisible: false,
dict: {}, // 字典
categoryList: [], // 应用分类列表
};
},
// 进入路由前
// beforeRouteEnter(to, from, text) {
// if (from.path === "/appmarket/appdetails") {
// to.meta.isBack = true;
// } else {
// to.meta.isBack = false;
// }
// text();
// },
// // 详情页返回不刷新数据
// activated() {
// if (!this.$route.meta.isBack) {
// Object.assign(this.$data, this.$options.data());
// this.getAppList();
// } else {
// this.$route.meta.isBack = false;
// }
// },
computed: {
...mapGetters("site", ["userInfo"]),
},
created() {
this.getCategoryList();
this.getAppList();
......@@ -232,7 +236,6 @@ export default {
...mapMutations("site", ["SET_appDict"]),
// 获取分类列表
async getCategoryList() {
this.loading = true;
let res = await getCategoryList({
page: 1,
size: -1,
......@@ -243,6 +246,7 @@ export default {
this.categoryList = data;
}
},
// 获取应用列表
async getAppList() {
this.loading = true;
......@@ -297,8 +301,17 @@ export default {
this.getAppList();
},
// 勾选表格
onSelectChange(keys) {
onSelectChange(keys, rows) {
this.selectedRowKeys = keys;
this.selectedAppList = [...this.selectedAppList, ...rows];
let map = new Map();
this.selectedAppList = this.selectedAppList
.filter((v) => {
return !map.has(v.id) && map.set(v.id, 1);
})
.filter((v) => {
return this.selectedRowKeys.some((item) => item == v.id);
});
},
// 编辑
handleEdit(row) {
......@@ -306,6 +319,16 @@ export default {
this.$refs.AddApp.onEdit(row);
this.AddVisible = true;
},
// 批量修改应用主题
handleTheme() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选应用");
return;
}
this.themVisible = true;
},
// 查看
handleCheck(id) {
this.$router.push({
......@@ -317,7 +340,7 @@ export default {
},
// 删除
handleDel(distribute, id) {
if (distribute) {
if (this.userInfo.id != 1 && distribute) {
this.$confirm({
title: "拒绝删除",
content: "该应用正在使用中。",
......@@ -359,6 +382,17 @@ export default {
},
});
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选应用");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(0, ids);
},
// 克隆成功
cloneSuccess() {
this.selectedRowKeys = [];
......
......@@ -4,6 +4,12 @@
<a-space>
<a-button type="primary" @click="handleAdd"> 新增应用 </a-button>
<a-button type="primary" @click="handleClone"> 克隆 </a-button>
<a-button type="primary" @click="handleTheme">
批量关联应用主题
</a-button>
<a-button v-permission="[1]" type="danger" @click="handleDelAll">
批量删除
</a-button>
</a-space>
<a-input-search
style="width: 300px"
......@@ -67,7 +73,7 @@
</template>
<!-- 版本 -->
<template slot="version" slot-scope="text">
{{ text.version ? "v" + text.version : "--" }}
{{ text.version || text.version == 0 ? "v" + text.version : "--" }}
</template>
<!-- 类型 -->
<template slot="appType" slot-scope="text">
......@@ -91,7 +97,7 @@
>
<span
class="delete pointer"
:class="{ unDelete: text.distribute }"
:class="{ unDelete: userInfo.id != 1 && text.distribute }"
@click="handleDel(text.distribute, text.id)"
>删除</span
>
......@@ -114,6 +120,13 @@
:appList="selectedRowKeys"
:siteVisible.sync="siteVisible"
></CheckSite>
<!-- 批量修改应用主题 -->
<ChangeThem
:themVisible.sync="themVisible"
:themList="categoryList"
:appList="selectedAppList"
@edit="cloneSuccess"
></ChangeThem>
</div>
</template>
......@@ -121,6 +134,7 @@
import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import AddApp from "../modal/AddApp.vue";
import CheckSite from "../modal/CheckSite.vue";
import ChangeThem from "../modal/ChangeThem.vue";
import {
getAppList,
deleteApp,
......@@ -128,7 +142,7 @@ import {
getCategoryList,
} from "@/services/market";
import local from "@/utils/local";
import { mapMutations } from "vuex";
import { mapMutations, mapGetters } from "vuex";
import { pageSizeOptions } from "@/config/pageConfig.js";
const columns = [
{
......@@ -184,6 +198,7 @@ export default {
YSwitch,
AddApp,
CheckSite,
ChangeThem,
},
data() {
return {
......@@ -198,15 +213,21 @@ export default {
size: 10,
total: 0,
pageSizeOptions,
selectedRowKeys: [], // 表格勾选数据
selectedRowKeys: [], // 表格勾选id列表
selectedAppList: [], // 表格勾选信息列表
AddVisible: false,
title: "新增应用",
siteVisible: false,
themVisible: false,
dict: {}, // 字典
categoryList: [], // 应用分类列表
};
},
computed: {
...mapGetters("site", ["userInfo"]),
},
created() {
this.getCategoryList();
this.getAppList();
......@@ -280,8 +301,17 @@ export default {
this.getAppList();
},
// 勾选表格
onSelectChange(keys) {
onSelectChange(keys, rows) {
this.selectedRowKeys = keys;
this.selectedAppList = [...this.selectedAppList, ...rows];
let map = new Map();
this.selectedAppList = this.selectedAppList
.filter((v) => {
return !map.has(v.id) && map.set(v.id, 1);
})
.filter((v) => {
return this.selectedRowKeys.some((item) => item == v.id);
});
},
// 编辑
handleEdit(row) {
......@@ -289,6 +319,16 @@ export default {
this.$refs.AddApp.onEdit(row);
this.AddVisible = true;
},
// 批量修改应用主题
handleTheme() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选应用");
return;
}
this.themVisible = true;
},
// 查看
handleCheck(id) {
this.$router.push({
......@@ -301,7 +341,7 @@ export default {
},
// 删除
handleDel(distribute, id) {
if (distribute) {
if (this.userInfo.id != 1 && distribute) {
this.$confirm({
title: "拒绝删除",
content: "该应用正在使用中。",
......@@ -343,6 +383,17 @@ export default {
},
});
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选应用");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(0, ids);
},
// 克隆成功
cloneSuccess() {
this.selectedRowKeys = [];
......
<template>
<div>
<a-modal v-model="Visible" title="请选择主题">
<a-form-model
ref="form"
:model="form"
:rules="rules"
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<a-form-model-item label="应用" prop="appThemeName">
<a-select placeholder="请选择主题" v-model="form.appThemeName">
<a-select-option
v-for="v in themList"
:key="v.id"
:value="'' + v.id"
>
{{ v.categoryName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
<div slot="footer">
<a-space size="middle">
<a-button @click="handleCancel">取消</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</a-space>
</div>
</a-modal>
</div>
</template>
<script>
import { batchSave } from "@/services/market";
export default {
props: {
themVisible: {
type: Boolean,
required: true,
default: false,
},
themList: {
type: Array,
required: true,
default: () => [],
},
appList: {
type: Array,
required: true,
default: () => [],
},
},
data() {
return {
form: {
appThemeName: undefined,
},
rules: {
appThemeName: [
{ required: true, message: "请选择主题", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.themVisible;
},
set(val) {
this.$emit("update:themVisible", val);
},
},
},
methods: {
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let arr = this.appList.map((v) => {
return {
...v,
appThemeName: this.form.appThemeName,
};
});
let res = await batchSave(arr);
let { code, msg } = res.data;
if (code == 1) {
this.$message.success(msg);
this.$emit("edit");
this.handleCancel();
}
}
});
},
// 取消
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
......@@ -16,10 +16,16 @@
@click="handleSync(siteData[0].id)"
>同步数据</a-button
>
<a-button type="primary" @click="editSiteInfo(siteData[0])"
<a-button
v-permission="[1]"
type="primary"
@click="editSiteInfo(siteData[0])"
>编辑</a-button
>
<a-button type="danger" @click="deleteSite(siteData[0].id, 0)"
<a-button
v-permission="[1]"
type="danger"
@click="deleteSite(siteData[0].id, 0)"
>删除</a-button
>
</a-space>
......
......@@ -55,6 +55,7 @@ import SelfService from "../selfservice/SelfService.vue";
import DesSelfService from "../desSelfservice/DesSelfService.vue";
import SignDevicekin from "../signdeviceskin/SignDeviceSkin.vue";
import InfoDisSkin from "../infoDisSkin/InfoDisSkin.vue";
import DefaultShow from "../defaultshow/DefaultShow.vue";
import { mapState, mapMutations } from "vuex";
import { filterItems } from "@/utils";
export default {
......@@ -71,6 +72,7 @@ export default {
DesSelfService,
SignDevicekin,
InfoDisSkin,
DefaultShow,
},
props: {},
data() {
......@@ -121,6 +123,8 @@ export default {
case "xxgk":
str = "InfoDisSkin";
break;
default:
str = "DefaultShow";
}
return str;
},
......
<template>
<div class="skin-box">
<!-- 1920*1080 -->
<div
:id="componentsId"
class="across-skin"
v-if="imageResolution === '1'"
:style="{
background: filterItem('1', 0),
}"
></div>
<!-- 竖版 1080*1920 -->
<div
class="vertical-skin"
:id="componentsId"
v-else-if="imageResolution === '2'"
:style="{
background: filterItem('1', 0),
}"
></div>
<!-- 空数据显示 -->
<div class="empty flex aic jcc" v-else>
<a-empty
:image="require('../../../../assets/img/original.png')"
:image-style="{
height: '80px',
}"
>
<span slot="description"> <a href="#API">暂无皮肤模板</a> </span>
</a-empty>
</div>
</div>
</template>
<script>
export default {
props: {
// imgItem: {
// type: Array,
// required: true,
// default: () => {
// return [];
// },
// },
skinFieldList: {
type: Array,
required: true,
default: () => {
return [];
},
},
imageResolution: {
required: true,
default: "1",
},
componentsId: {
required: true,
type: String,
},
},
data() {
return {
api: process.env.VUE_APP_API_IMG_URL,
};
},
methods: {
// 过滤属性类型
filterItem(type, index) {
let arr = this.skinFieldList.filter((v) => {
return v.remark == type;
});
if (arr.length) {
return this.filterValueType(arr[index]);
} else {
return "";
}
},
// 过滤属性值类型
filterValueType(info = {}) {
let value = "";
if (info.fieldType !== "" && info.fieldType === "1" && info.fieldValue) {
value = info.fieldValue;
} else if (
info.fieldType !== "" &&
info.fieldType === "2" &&
info.fieldValue
) {
value = `url(${this.api + info.fieldValue})`;
}
return value;
},
// 过滤导航
filterNav(type) {
let arr = [];
arr = this.skinFieldList.filter((v) => {
return v.remark == type;
});
return arr;
},
},
};
</script>
<style lang="less" scoped>
.across-skin {
width: 1000px;
height: 562.5px;
color: #fff;
background-image: linear-gradient(#26c5ff, #2c66ff);
background-repeat: no-repeat !important;
background-position: center !important;
background-size: 100% 100% !important;
}
.vertical-skin {
height: 1000px;
width: 562px;
padding: 10px;
background-image: linear-gradient(#26c5ff, #2c66ff);
background-repeat: no-repeat !important;
background-position: center !important;
background-size: 100% 100% !important;
}
</style>
......@@ -196,6 +196,7 @@ import SelfService from "../selfservice/SelfService.vue";
import DesSelfService from "../desSelfservice/DesSelfService.vue";
import SignDevicekin from "../signdeviceskin/SignDeviceSkin.vue";
import InfoDisSkin from "../infoDisSkin/InfoDisSkin.vue";
import DefaultShow from "../defaultshow/DefaultShow.vue";
import { uploadFile, skinSave, getTemplateList } from "@/services/surface";
import html2canvas from "html2canvas";
import { Empty } from "ant-design-vue";
......@@ -215,6 +216,7 @@ export default {
DesSelfService,
SignDevicekin,
InfoDisSkin,
DefaultShow,
},
props: {
isShow: {
......@@ -312,6 +314,8 @@ export default {
case "xxgk":
str = "InfoDisSkin";
break;
default:
str = "DefaultShow";
}
return str;
},
......
......@@ -285,6 +285,7 @@ module.exports = {
list: `${BASE_URL}/base/app/list`,
info: `${BASE_URL}/base/app/info`,
save: `${BASE_URL}/base/app/save`,
batchSave: `${BASE_URL}/base/app/batchSave`,
delete: `${BASE_URL}/base/app/delete`,
distribute: `${BASE_URL}/base/app/appDistribute`,
clone: `${BASE_URL}/base/app/cloneAppsBySites`,
......
......@@ -27,6 +27,10 @@ export async function getAppInfo(data) {
export async function saveApp(data) {
return request(App.save, METHOD.POST, data);
}
// 新增,修改应用(批量)
export async function batchSave(data) {
return request(App.batchSave, METHOD.POST, data);
}
// 删除应用
export async function deleteApp(data) {
return request(App.delete, METHOD.GET, 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