Commit e88949d2 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents f693ceb3 3fe0cdd8
......@@ -9,12 +9,9 @@
@click="handleUpload"
>上传配置文件</a-button
>
<a-tab-pane key="/appmarket/terminalapp" tab="终端应用">
<!-- <TerminalApp></TerminalApp> -->
</a-tab-pane>
<a-tab-pane key="/appmarket/moveapp" tab="移动端应用" force-render>
<!-- <MoveApp></MoveApp> -->
</a-tab-pane>
<a-tab-pane key="/appmarket/terminalapp" tab="终端应用"> </a-tab-pane>
<a-tab-pane key="/appmarket/moveapp" tab="移动端应用"> </a-tab-pane>
<a-tab-pane key="/appmarket/blackapp" tab="应用黑名单"> </a-tab-pane>
</a-tabs>
<div class="app-out-box flex1">
<router-view></router-view>
......
<template>
<div class="black-app">
<div class="left">
<div class="header">
<h3 class="titel">设备应用黑名单</h3>
<div class="control">
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button>
<div class="business-control">
<a-space>
<!-- <a-select
style="min-width: 120px"
v-model="leftHallSearch"
showSearch
optionFilterProp="label"
>
<a-select-option value="" label="全部应用"> </a-select-option>
<a-select-option
v-for="v in appList"
:key="v.id"
:value="v.id"
:label="v.name"
>
{{ v.name }}
</a-select-option>
</a-select> -->
<a-input-search
placeholder="请输入应用名称搜索"
enter-button="搜索"
v-model="leftSearch.name"
@search="onSearchLeft"
allowClear
/>
</a-space>
</div>
</div>
</div>
<div class="table-content">
<!-- 表格 -->
<a-table
bordered
:loading="leftLoading"
size="middle"
:scroll="{ y: 550 }"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: leftCurrent,
total: leftTotal,
pageSize: leftSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: changeLeft,
onShowSizeChange: showSizeChange,
}"
:columns="leftColumns"
:data-source="blackApp"
:row-selection="{
selectedRowKeys: selectedLeftRowKeys,
onChange: onSelectChange,
}"
:rowKey="(record) => record.id"
>
<template slot="num" slot-scope="text, record, index">
<span>
{{ (leftCurrent - 1) * leftSize + index + 1 }}
</span>
</template>
<template slot="action" slot-scope="text">
<a href="javascript:;" class="delete" @click="handleDel(text.id)"
>移除</a
>
</template>
</a-table>
</div>
</div>
<!-- 右 -->
<div class="right">
<div class="header">
<h3 class="titel">站点设备</h3>
<div class="control">
<div>
<!-- <a-button type="primary" @click="handleAddAll"> 批量加入 </a-button> -->
</div>
<div class="business-control">
<a-space>
<a-select
style="min-width: 120px"
v-model="rightSearch.type"
showSearch
optionFilterProp="label"
>
<a-select-option value="" label="全部类型"
>全部类型
</a-select-option>
<a-select-option
v-for="(v, i) in devType"
:key="i"
:value="v"
:label="v"
>
{{ v }}
</a-select-option>
</a-select>
<a-input-search
placeholder="请输入设备编码搜索"
enter-button="搜索"
v-model="rightSearch.deviceCode"
@search="onSearch"
allowClear
/>
</a-space>
</div>
</div>
</div>
<div class="table-content">
<!-- 表格 -->
<a-table
bordered
:scroll="{ y: 550 }"
:loading="rightLoading"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: rightCurrent,
total: rightTotal,
pageSize: rightSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: changeRight,
onShowSizeChange: showSizeChangeRight,
}"
size="middle"
:columns="rightColumns"
:data-source="deviceList"
:rowKey="(record) => record.id"
>
<template slot="num" slot-scope="text, record, index">
<span>
{{ (rightCurrent - 1) * rightSize + index + 1 }}
</span>
</template>
<template slot="deviceStatus" slot-scope="text">
<a-tag color="blue" v-if="text.deviceStatus == 0"> 未激活 </a-tag>
<a-tag color="red" v-else-if="text.deviceStatus == 1"> 离线 </a-tag>
<a-tag color="green" v-else-if="text.deviceStatus == 2">
在线
</a-tag>
</template>
<template slot="action" slot-scope="text">
<a-space size="middle">
<a class="jion" @click="handleIn(text)">加入黑名单</a>
</a-space>
</template>
</a-table>
</div>
</div>
<!-- 添加黑名单 -->
<DevToBlack
:addVisile.sync="visible"
ref="DevToBlack"
@addSuccess="addSuccess"
></DevToBlack>
</div>
</template>
<script>
import {
getDeviceList,
getBlackAppList,
deleteBlackapp,
} from "@/services/market";
import local from "@/utils/local";
import DevToBlack from "../modal/DevToBlack.vue";
const devType = [
"排队机",
"窗口屏",
"呼叫器",
"集中显示屏",
"评价器",
"信息发布屏",
"导视机",
"自助服务终端",
"填单机",
"一码通",
"LED通屏",
"取件柜",
"背靠背评价设备",
"存取件",
"桌面式自助服务终端",
];
export default {
components: { DevToBlack },
data() {
const leftColumns = [
{
title: "序号",
width: "50px",
scopedSlots: { customRender: "num" },
},
{
title: "应用名称",
dataIndex: "appName",
},
{
title: "设备名称",
customRender: (text) => {
return text.deviceName || "--";
},
},
{
title: "设备编码",
dataIndex: "deviceCode",
},
{
title: "操作",
width: "110px",
scopedSlots: {
customRender: "action",
},
},
];
const rightColumns = [
{
title: "序号",
key: "id",
width: "50px",
scopedSlots: { customRender: "num" },
},
{
title: "设备名称",
customRender: (text) => {
return text.deviceName || "--";
},
},
{
title: "设备编码",
dataIndex: "deviceCode",
},
{
title: "设备类型",
dataIndex: "productName",
},
{
title: "设备状态",
width: "10%",
scopedSlots: { customRender: "deviceStatus" },
},
{
title: "操作",
width: "110px",
scopedSlots: {
customRender: "action",
},
},
];
return {
devType,
leftColumns,
rightColumns,
leftLoading: false,
rightLoading: false,
leftSearch: {
name: "",
},
rightSearch: {
deviceCode: "",
type: "",
},
selectedLeftRowKeys: [],
selectedRowKeys: [],
selectedRows: [],
visible: false,
leftCurrent: 1,
rightCurrent: 1,
leftTotal: 0,
rightTotal: 0,
leftSize: 10,
rightSize: 10,
pageSizeOptions: ["10", "30", "50", "100"],
siteId: local.getLocal("siteId"), // 站点id
deviceList: [], // 站点设备列表
blackApp: [], // 应用黑名单列表
};
},
created() {
this.getBlackAppList();
this.getDeviceList();
},
methods: {
// 获取设备黑名单
async getBlackAppList() {
this.leftLoading = true;
let res = await getBlackAppList({
page: this.leftCurrent,
size: this.leftSize,
appName: `%${this.leftSearch.name}%`,
siteId: this.siteId,
});
if (res.data.code == 1) {
let { data, total } = res.data.data;
if (!data.length && this.leftCurrent > 1) {
this.leftCurrent -= 1;
this.getBlackAppList();
}
this.blackApp = data;
this.leftTotal = total;
}
this.leftLoading = false;
},
// 获取站点设备列表
async getDeviceList() {
this.rightLoading = true;
let res = await getDeviceList({
page: this.rightCurrent,
size: this.rightSize,
siteId: this.siteId,
deviceCode: `%${this.rightSearch.deviceCode}%`,
productName: `%${this.rightSearch.type}%`,
});
if (res.data.code == 1) {
let { data, total } = res.data.data;
this.deviceList = data;
this.rightTotal = total;
console.log(data);
}
this.rightLoading = false;
},
// 左边搜索
onSearchLeft() {
this.leftCurrent = 1;
this.selectedLeftRowKeys = [];
this.getBlackAppList();
},
// 删除
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 deleteBlackapp({ id });
let { code, msg } = res.data;
if (code == 1) {
_this.$message.success(msg);
_this.selectedLeftRowKeys = [];
_this.getBlackAppList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 左边选中
onSelectChange(key) {
this.selectedLeftRowKeys = key;
},
// 批量删除
handleDelAll() {
if (!this.selectedLeftRowKeys.length) {
this.$message.warning("请先勾选数据");
return;
}
let ids = this.selectedLeftRowKeys.join(",");
this.handleDel(ids);
},
// 获取批量加入id
// onRightSelectChange(keys, rows) {
// this.selectedRowKeys = keys;
// const res = new Map();
// this.selectedRows = [...this.selectedRows, ...rows]
// .filter((v) => {
// return !res.has(v.id) && res.set(v.id, 1);
// })
// .filter((v) => {
// return this.selectedRowKeys.some((val) => v.id == val);
// });
// },
// 批量加入
// handleAddAll() {
// if (!this.selectedRows.length) {
// this.$message.warning("请先勾选数据");
// return;
// }
// this.handleIn(this.selectedRows);
// },
// 左翻页
changeLeft(cur) {
this.leftCurrent = cur;
this.getBlackAppList();
},
// 左边改变每页显示数量
showSizeChange(current, size) {
this.leftCurrent = current;
this.leftSize = size;
this.getBlackAppList();
},
// 右翻页
changeRight(cur) {
this.rightCurrent = cur;
this.getDeviceList();
},
// 右边改变显示数量
showSizeChangeRight(current, size) {
this.rightCurrent = current;
this.rightSize = size;
this.getDeviceList();
},
// 搜索
async onSearch() {
this.rightCurrent = 1;
this.getDeviceList();
},
// 加入
handleIn(row) {
this.$refs.DevToBlack.onAdd(row);
this.visible = true;
},
// 加入成功
addSuccess() {
this.selectedRowKeys = [];
this.selectedRows = [];
this.getBlackAppList();
// this.getDeviceList();
},
},
};
</script>
<style lang="less" scoped>
.black-app {
width: 100%;
height: 100%;
display: flex;
position: relative;
&::after {
content: "";
width: 1px;
height: 100%;
position: absolute;
background-color: #eeeeee;
top: 0px;
left: 50%;
}
.left,
.right {
width: 50%;
.header {
height: 100px;
.titel {
margin-bottom: 15px;
}
}
}
.left {
padding-right: 15px;
}
.right {
padding-left: 15px;
}
.control {
width: 100%;
display: flex;
justify-content: space-between;
}
}
.add-btn {
background-color: #04cb8f;
color: #fff;
}
</style>
\ No newline at end of file
<template>
<div>
<a-modal
v-model="Visible"
:maskClosable="false"
title="新增应用黑名单"
@cancel="handleClose"
destroyOnClose
centered
>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<a-form-model
ref="form"
:model="form"
:rules="rules"
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<a-form-model-item label="应用" prop="appId">
<a-select
@change="handleChange"
labelInValue
placeholder="请选择应用"
v-model="selectInfo"
>
<a-select-option v-for="v in appList" :key="v.id" :value="v.id">
{{ v.appName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveBlackApp, getAppList } from "@/services/market";
export default {
props: {
addVisile: {
type: Boolean,
require: true,
default: false,
},
},
components: {},
data() {
return {
selectInfo: undefined,
form: {
siteId: "", // 站点id
deviceId: "", // 设备id
deviceCode: "", // 设备编码
deviceName: "", // 设备名称
appId: "", // 应用id
appName: "", // 应用名称
appCode: "", // 应用编码
},
appList: [], // app列表
devList: [], // 设备列表
rules: {
appId: [{ required: true, message: "请选择应用", trigger: "change" }],
},
};
},
computed: {
Visible: {
get() {
return this.addVisile;
},
set(val) {
this.$emit("update:addVisile", val);
},
},
},
created() {
this.getAppList();
},
methods: {
// 获取应用列表
async getAppList() {
let res = await getAppList({
page: 1,
size: -1,
type: 1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.appList = data;
}
},
// 切换选择
handleChange(row) {
this.form.appId = row.key;
this.form.appName = row.label;
},
// 新增
onAdd(row) {
this.form.siteId = row.siteId;
this.form.deviceId = row.id;
this.form.deviceCode = row.deviceCode;
this.form.deviceName = row.deviceName;
},
// 关闭弹窗
handleClose() {
this.selectInfo = undefined;
this.$refs.form.resetFields();
this.Visible = false;
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let res = await saveBlackApp(this.form);
let { code, msg } = res.data;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleClose();
}
}
});
},
// 重置
handleReset() {
this.selectInfo = undefined;
this.$refs.form.resetFields();
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
......@@ -27,7 +27,7 @@
<a-button type="primary" @click="editSiteInfo(item)"
>编辑</a-button
>
<a-button type="danger" @click="deleteSite(item.id)"
<a-button type="danger" @click="deleteSite(item.id, index)"
>删除</a-button
>
</div>
......@@ -200,16 +200,10 @@
</div>
<div v-else class="empty-show">
<a-empty description="暂无站点" />
<div class="btn_box" v-if="!siteData.length">
<div style="width: 200px">
<a-button block size="large" @click="addSiteAll"
>新增站点</a-button
>
</div>
</div>
</div>
<!-- 切换站点 -->
<!-- <div class="cut-btn">
<div class="cut-btn flex aic jcb">
<div>
<a-icon
type="vertical-right"
......@@ -217,6 +211,13 @@
@click="changePage(-1)"
/>
</div>
<div class="btn_box">
<div style="width: 200px">
<a-button block size="large" @click="addSiteAll"
>新增站点</a-button
>
</div>
</div>
<div>
<a-icon
type="vertical-left"
......@@ -224,7 +225,7 @@
@click="changePage(1)"
/>
</div>
</div> -->
</div>
</div>
</a-spin>
</div>
......@@ -323,7 +324,7 @@ export default {
},
// 删除
deleteSite(val) {
deleteSite(val, index) {
let _this = this;
this.$confirm({
title: "系统提示",
......@@ -339,7 +340,11 @@ export default {
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getSiteList({ areaID: _this.areaID });
_this.siteData.splice(index, 1);
if (index > 0) {
_this.active -= 1;
}
// _this.getSiteList({ areaID: _this.areaID });
}
},
onCancel() {
......@@ -431,6 +436,7 @@ export default {
height: 100%;
padding-left: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.rigth-content {
......@@ -438,6 +444,7 @@ export default {
height: 100%;
}
.cut-btn {
width: 100%;
margin-top: 30px;
display: flex;
justify-content: space-between;
......
......@@ -256,6 +256,14 @@ const options = {
// keepAlive: true,
},
},
{
path: "blackapp",
component: () =>
import("@/pages/basicset/appmarket/components/BlackApp"),
meta: {
invisible: true,
},
},
],
},
{
......
......@@ -355,4 +355,14 @@ module.exports = {
batchSave: `${BASE_URL}/base/window/hall/batchSave`,
delete: `${BASE_URL}/base/window/hall/delete`,
},
// 设备
device: {
list: `${BASE_URL}/base/device/list`,
},
// 应用黑名单
blackapp: {
list: `${BASE_URL}/base/device/blackapp/list`,
save: `${BASE_URL}/base/device/blackapp/save`,
delete: `${BASE_URL}/base/device/blackapp/delete`,
},
};
......@@ -4,6 +4,8 @@ import {
appField,
templete,
version,
device,
blackapp,
} from "@/services/basicsetApi";
import { request, METHOD } from "@/utils/request";
......@@ -136,3 +138,29 @@ export async function usedVersion(data) {
export async function previewVersion(data) {
return request(version.preview, METHOD.GET, data);
}
/**
* 设备列表
*/
export async function getDeviceList(data) {
return request(device.list, METHOD.POST, data);
}
/**
* 设备应用黑名单
*/
// 获取应用黑名单列表
export async function getBlackAppList(data) {
return request(blackapp.list, METHOD.POST, data);
}
// 保存
export async function saveBlackApp(data) {
return request(blackapp.save, METHOD.POST, data);
}
// 删除
export async function deleteBlackapp(data) {
return request(blackapp.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