20 changed files with 2531 additions and 110 deletions
@ -0,0 +1,50 @@
|
||||
import request from '@/router/axios'; |
||||
//列表
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api/iot-sim/helpcenter/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
//删除
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: '/api/iot-sim/helpcenter/remove', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
//详情
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api/iot-sim/helpcenter/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
//新增
|
||||
export const add = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/helpcenter/save', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
//修改
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/helpcenter/update', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
@ -0,0 +1,50 @@
|
||||
import request from '@/router/axios'; |
||||
//列表
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api/iot-sim/smartreply/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
//删除
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: '/api/iot-sim/smartreply/remove', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
//详情
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api/iot-sim/smartreply/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
//新增
|
||||
export const add = (data) => { |
||||
return request({ |
||||
url: '/api/iot-sim/smartreply/save', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
||||
//修改
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/smartreply/update', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
@ -0,0 +1,50 @@
|
||||
import request from '@/router/axios'; |
||||
//列表
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api/iot-sim/productspecs/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
//删除
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: '/api/iot-sim/productspecs/remove', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
//详情
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api/iot-sim/productspecs/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
//新增
|
||||
export const add = (data) => { |
||||
return request({ |
||||
url: '/api/iot-sim/productspecs/save', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
||||
//修改
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/productspecs/update', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
@ -0,0 +1,111 @@
|
||||
import request from '@/router/axios'; |
||||
//告警规则列表
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrule/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
//告警规则详情
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrule/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
//告警规则新增
|
||||
export const add = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrule/save', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
//告警规则删除
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrule/remove', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
//告警规则修改
|
||||
export const update = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrule/update', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
|
||||
|
||||
//告警范围列表
|
||||
export const getLists = (current, size, params, ) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrange/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
|
||||
} |
||||
}) |
||||
} |
||||
//告警范围详情
|
||||
export const getDetails = (id) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrange/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
|
||||
//告警范围新增
|
||||
export const adds = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrange/save', |
||||
method: 'post', |
||||
params: { |
||||
...row |
||||
} |
||||
}) |
||||
} |
||||
//告警范围删除
|
||||
export const removes = (ids) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrange/remove', |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
//告警范围修改
|
||||
export const updates = (row) => { |
||||
return request({ |
||||
url: '/api/iot-sim/alarmrange/update', |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
//流量卡
|
||||
export const simcardList = (query) => { |
||||
return request({ |
||||
url: '/api/iot-sim/simcarddeliver/waitingSpeedLimit', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,297 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:upload-before="uploadBefore" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
add, |
||||
getDetail, |
||||
getList, |
||||
remove, |
||||
update, |
||||
} from "@/api/mallmanagement/help"; |
||||
import { substr } from "@/util/util"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
|
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
viewBtn: true, |
||||
columnBtn: true, |
||||
addBtn: true, |
||||
dialogClickModal: false, |
||||
dialogWidth: "59%", |
||||
labelWidth: 125, |
||||
column: [ |
||||
{ |
||||
label: "名称", |
||||
prop: "name", |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "标题", |
||||
prop: "title", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入标题", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "描述", |
||||
prop: "describe", |
||||
type: "textarea", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入描述", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "是否显示", |
||||
prop: "isShow", |
||||
search: true, |
||||
type: "select", |
||||
|
||||
dicData: [ |
||||
{ |
||||
label: "是", |
||||
value: 2, |
||||
}, |
||||
{ |
||||
label: "否", |
||||
value: 1, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择是否显示", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "图片列表", |
||||
prop: "images", |
||||
type: "upload", |
||||
accept: ".jpg,.JPG", |
||||
loadText: "图片上传中,请稍等", |
||||
dataType: "string", |
||||
span: 24, |
||||
hide: true, |
||||
oss: "ali", |
||||
listType: "picture-card", |
||||
tip: "只能上传jpg文件,且不超过500kb", |
||||
rules: [ |
||||
{ |
||||
required: false, |
||||
message: "请上传图片", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "视频", |
||||
prop: "video", |
||||
type: "upload", |
||||
accept: ".mp4", |
||||
loadText: "视频上传中,请稍等", |
||||
span: 24, |
||||
hide: true, |
||||
oss: "ali", |
||||
listType: "picture-img", |
||||
tip: "只能上传mp4文件,且不超过20mb", |
||||
rules: [ |
||||
{ |
||||
required: false, |
||||
message: "请上传图片", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
let imgArr = []; |
||||
row.images.split(",").forEach((element) => { |
||||
imgArr.push(substr(element)); |
||||
}); |
||||
row.images = imgArr.toString(); |
||||
row.video = substr(row.video); |
||||
add(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
window.console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
let imgArr = []; |
||||
row.images.split(",").forEach((element) => { |
||||
imgArr.push(substr(element)); |
||||
}); |
||||
row.images = imgArr.toString(); |
||||
row.video = substr(row.video); |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
uploadBefore(file, done, loading, column) { |
||||
if (file.type.indexOf("image") != -1) { |
||||
if (file.type != "image/jpg" && file.type != "image/jpeg") { |
||||
this.$message.warning("上传图片只能是 jpg 格式"); |
||||
loading(); |
||||
} else { |
||||
var timestamp = Date.parse(new Date()); |
||||
let newFile = new File([file], "/sim/help/" + timestamp + ".jpg", { |
||||
type: file.type, |
||||
}); |
||||
done(newFile); |
||||
} |
||||
} |
||||
if (file.type.indexOf("video") != -1) { |
||||
var fileSize = file.size / 1024 / 1024 < 20; |
||||
if (!fileSize) { |
||||
this.$message.warning("视频大小不能超过20MB"); |
||||
loading(); |
||||
} else { |
||||
var timestamp = Date.parse(new Date()); |
||||
let newFile = new File([file], "/sim/help/" + timestamp + ".mp4", { |
||||
type: file.type, |
||||
}); |
||||
done(newFile); |
||||
} |
||||
} |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -0,0 +1,180 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
add, |
||||
getDetail, |
||||
getList, |
||||
remove, |
||||
update, |
||||
} from "@/api/mallmanagement/reply"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
viewBtn: true, |
||||
columnBtn: true, |
||||
addBtn: true, |
||||
dialogClickModal: false, |
||||
dialogWidth: "59%", |
||||
labelWidth: 125, |
||||
column: [ |
||||
{ |
||||
label: "关键词", |
||||
prop: "keys", |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入关键词", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "回复内容", |
||||
prop: "values", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入回复内容", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
add(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
window.console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -0,0 +1,300 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:upload-before="uploadBefore" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
add, |
||||
getDetail, |
||||
getList, |
||||
remove, |
||||
update, |
||||
} from "@/api/mallmanagement/specification"; |
||||
import { substr } from "@/util/util"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
viewBtn: true, |
||||
columnBtn: true, |
||||
addBtn: true, |
||||
dialogClickModal: false, |
||||
dialogWidth: "59%", |
||||
labelWidth: 125, |
||||
column: [ |
||||
{ |
||||
label: "所属商品", |
||||
prop: "productId", |
||||
type: "select", |
||||
dataType: "String", |
||||
search: true, |
||||
dicUrl: "/api/iot-sim/product/fillData", |
||||
props: { |
||||
label: "name", |
||||
value: "id", |
||||
}, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择所属商品", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "规格名称", |
||||
prop: "name", |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入规格名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "商品单价", |
||||
prop: "price", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入商品单价", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "排序号", |
||||
prop: "sort", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入排序号", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "是否上架", |
||||
prop: "isShow", |
||||
search: true, |
||||
type: "select", |
||||
|
||||
dicData: [ |
||||
{ |
||||
label: "上架", |
||||
value: 2, |
||||
}, |
||||
{ |
||||
label: "下架", |
||||
value: 1, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择是否上架", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "是否默认", |
||||
prop: "isDefault", |
||||
search: true, |
||||
type: "select", |
||||
|
||||
dicData: [ |
||||
{ |
||||
label: "是", |
||||
value: 2, |
||||
}, |
||||
{ |
||||
label: "否", |
||||
value: 1, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择是否默认", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "缩略图", |
||||
prop: "thumb", |
||||
type: "upload", |
||||
accept: ".jpg,.JPG", |
||||
loadText: "图片上传中,请稍等", |
||||
listType: "picture-img", |
||||
dataType: "string", |
||||
oss: "ali", |
||||
hide: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请上传图片", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
tip: "只能上传jpg文件", |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
row.thumb = substr(row.thumb); |
||||
add(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
window.console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
row.thumb = substr(row.thumb); |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
uploadBefore(file, done, loading) { |
||||
if (file.size > 500 * 1024) { |
||||
this.$message.warning("图片大小切勿大于500kb"); |
||||
loading(); |
||||
} else if (file.type !== "image/jpg" && file.type !== "image/jpeg") { |
||||
this.$message.warning("上传图片只能是 JPG 格式"); |
||||
loading(); |
||||
} else { |
||||
var timestamp = Date.parse(new Date()); |
||||
let newFile = new File( |
||||
[file], |
||||
"/sim/productSpecs/" + timestamp + ".jpg", |
||||
{ |
||||
type: file.type, |
||||
} |
||||
); |
||||
done(newFile); |
||||
} |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -0,0 +1,231 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getDetail, |
||||
getList, |
||||
add, |
||||
remove, |
||||
update, |
||||
} from "@/api/packagemanage/packgegroup"; |
||||
import { mapGetters } from "vuex"; |
||||
import { getToken } from "@/util/auth"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
isSources: { |
||||
isSource: 2, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: true, |
||||
viewBtn: true, |
||||
dialogDrag: true, //表单窗口拖拽 |
||||
delBtn: true, |
||||
editBtn: true, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "60%", |
||||
column: [ |
||||
{ |
||||
label: "目标套餐组名称", |
||||
prop: "name", |
||||
span: 12, |
||||
labelWidth: 130, |
||||
searchLabelWidth: 120, |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入目标套餐组名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "目标套餐组类型", |
||||
prop: "type", |
||||
span: 12, |
||||
type: "select", |
||||
searchLabelWidth: 120, |
||||
search: true, |
||||
labelWidth: 130, |
||||
dicUrl: "/api/iot-system/dict/dictionary?code=dataPlanGroupType", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择目标套餐组类型", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
// viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
// editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
// delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
//新增 |
||||
rowSave(row, done, loading) { |
||||
add(Object.assign(row, this.isSources)).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
window.console.log(error); |
||||
loading(); |
||||
} |
||||
); |
||||
}, |
||||
//修改 |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
window.console.log(error); |
||||
loading(); |
||||
} |
||||
); |
||||
}, |
||||
//删除 |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
//导出 |
||||
handleExport() { |
||||
if (process.env.NODE_ENV === "production") { |
||||
window.open( |
||||
`http://223.99.228.240:18081/bd-core/tenant/dailybill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}` |
||||
); |
||||
} else { |
||||
window.open( |
||||
`/api/iot-sim/simcard/export-simCard?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}` |
||||
); |
||||
} |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query, this.isSources) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -0,0 +1,422 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<!-- <template slot="menuLeft"> |
||||
<el-button |
||||
size="small" |
||||
type="primary" |
||||
icon="el-icon-download" |
||||
@click="handleExport" |
||||
>导出 |
||||
</el-button> |
||||
</template> --> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getDetail, |
||||
getList, |
||||
add, |
||||
remove, |
||||
update, |
||||
} from "@/api/packagemanage/package"; |
||||
import { mapGetters } from "vuex"; |
||||
import { getToken } from "@/util/auth"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: false, |
||||
isSources: { |
||||
isSource: 2, |
||||
}, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
dialogDrag: true, //表单窗口拖拽 |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: true, |
||||
viewBtn: true, |
||||
delBtn: true, |
||||
editBtn: true, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "60%", |
||||
column: [ |
||||
// { |
||||
// label: "租户名称", |
||||
// prop: "tenantId", |
||||
// type: "select", |
||||
// dicUrl: "/api/iot-system/tenant/fillData", |
||||
// props: { |
||||
// label: "tenantName", |
||||
// value: "tenantId", |
||||
// }, |
||||
// dataType: "String", |
||||
// span: 12, |
||||
// labelWidth: 130, |
||||
// width: 140, |
||||
// search: true, |
||||
// rules: [ |
||||
// { required: true, message: "请选择租户名称", trigger: "change" }, |
||||
// ], |
||||
// }, |
||||
{ |
||||
label: "套餐组名称", |
||||
prop: "dataPlanGroupId", |
||||
span: 12, |
||||
type: "select", |
||||
searchLabelWidth: 120, |
||||
search: true, |
||||
labelWidth: 130, |
||||
dicUrl: "/api/iot-sim/dataplangroup/fillData?isSource=" + 2, |
||||
props: { |
||||
label: "name", |
||||
value: "id", |
||||
}, |
||||
dataType: "String", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择套餐组名称", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "目标套餐名称", |
||||
prop: "name", |
||||
span: 12, |
||||
labelWidth: 130, |
||||
searchLabelWidth: 100, |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入目标套餐名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
{ |
||||
label: "套餐类型", |
||||
prop: "type", |
||||
span: 12, |
||||
type: "select", |
||||
searchLabelWidth: 100, |
||||
search: true, |
||||
labelWidth: 130, |
||||
dicUrl: "/api/iot-system/dict/dictionary?code=dataPlanType", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择套餐类型", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "生效类型", |
||||
prop: "activateType", |
||||
span: 12, |
||||
type: "select", |
||||
searchLabelWidth: 100, |
||||
search: true, |
||||
labelWidth: 130, |
||||
dicUrl: "/api/iot-system/dict/dictionary?code=activateType", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择生效类型", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "套餐使用类型", |
||||
prop: "usageType", |
||||
span: 12, |
||||
type: "select", |
||||
searchLabelWidth: 100, |
||||
search: true, |
||||
labelWidth: 130, |
||||
dicUrl: "/api/iot-system/dict/dictionary?code=usageType", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择套餐使用类型", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "套餐总量(M)", |
||||
prop: "total", |
||||
span: 12, |
||||
type: "number", |
||||
labelWidth: 130, |
||||
searchLabelWidth: 100, |
||||
search: false, |
||||
rules: [ |
||||
{ required: true, message: "请输入套餐总量", trigger: "blur" }, |
||||
{ |
||||
pattern: /^\d+(\.\d+)?$/, |
||||
message: "请输入正确的套餐总量", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
// { |
||||
// label: "成本价", |
||||
// prop: "costPrice", |
||||
// span: 12, |
||||
// type: "number", |
||||
// labelWidth: 130, |
||||
// searchLabelWidth: 100, |
||||
// search: false, |
||||
// hide: true, |
||||
// rules: [ |
||||
// { required: true, message: "请输入成本价", trigger: "blur" }, |
||||
// { |
||||
// pattern: /^\d+(\.\d+)?$/, |
||||
// message: "请输入正确的成本价", |
||||
// trigger: "blur", |
||||
// }, |
||||
// ], |
||||
// }, |
||||
{ |
||||
label: "价格", |
||||
prop: "price", |
||||
span: 12, |
||||
type: "number", |
||||
labelWidth: 130, |
||||
searchLabelWidth: 100, |
||||
search: false, |
||||
hide: true, |
||||
rules: [ |
||||
{ required: true, message: "请输入价格", trigger: "blur" }, |
||||
{ |
||||
pattern: /^\d+(\.\d+)?$/, |
||||
message: "请输入正确的价格", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "订购数量", |
||||
prop: "orderCount", |
||||
span: 12, |
||||
type: "number", |
||||
labelWidth: 130, |
||||
searchLabelWidth: 100, |
||||
search: false, |
||||
rules: [ |
||||
{ required: true, message: "请输入订购数量", trigger: "blur" }, |
||||
{ |
||||
pattern: /^\d+?$/, |
||||
message: "请输入正确的订购数量", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "停机多少天后注销账户", |
||||
prop: "stopClose", |
||||
span: 12, |
||||
type: "number", |
||||
labelWidth: 170, |
||||
searchLabelWidth: 100, |
||||
search: false, |
||||
hide: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入停机多少天后注销账户", |
||||
trigger: "blur", |
||||
}, |
||||
{ |
||||
pattern: /^\d+?$/, |
||||
message: "请输入正确的天数", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "套餐内容", |
||||
prop: "content", |
||||
span: 24, |
||||
type: "textarea", |
||||
labelWidth: 130, |
||||
searchLabelWidth: 100, |
||||
hide: true, |
||||
search: false, |
||||
rules: [ |
||||
{ required: true, message: "请输入套餐内容", trigger: "blur" }, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
// viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
// editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
// delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
//新增 |
||||
rowSave(row, done, loading) { |
||||
add(Object.assign(row, this.isSources)).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
window.console.log(error); |
||||
loading(); |
||||
} |
||||
); |
||||
}, |
||||
//修改 |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
window.console.log(error); |
||||
loading(); |
||||
} |
||||
); |
||||
}, |
||||
//删除 |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
//导出 |
||||
handleExport() { |
||||
window.open( |
||||
`${this.baseUrl}/${this.apis}bd-core/tenant/dailybill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}` |
||||
); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query, this.isSources) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -0,0 +1,754 @@
|
||||
<template> |
||||
<basic-container> |
||||
<el-tabs v-model="activeName" @tab-click="handleClick"> |
||||
<el-tab-pane label="告警规则" name="first"> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot-scope="scope" slot="menu"> |
||||
<el-button @click="handleAlarmOption(scope)" type="text" size="mini" |
||||
><span class="el-icon-document"></span> 告警范围</el-button |
||||
> |
||||
</template> |
||||
</avue-crud> |
||||
</el-tab-pane> |
||||
<el-tab-pane label="告警范围" name="second" disabled> |
||||
<avue-crud |
||||
:option="options" |
||||
:table-loading="loadings" |
||||
:data="datas" |
||||
:page.sync="pages" |
||||
:before-open="beforeOpens" |
||||
v-model="forms" |
||||
ref="crud" |
||||
@search-change="searchChanges" |
||||
@search-reset="searchResets" |
||||
@current-change="currentChanges" |
||||
@size-change="sizeChanges" |
||||
@refresh-change="refreshChanges" |
||||
@on-load="onLoads" |
||||
> |
||||
<template slot-scope="scope" slot="menuLeft"> |
||||
<el-button type="primary" size="small" @click="handleAlarmAdd" |
||||
><span class="el-icon-plus"></span> 新增</el-button |
||||
> |
||||
</template> |
||||
<template slot-scope="scope" slot="menu"> |
||||
<el-button type="text" size="small" @click="handleAlarmDel(scope)" |
||||
><span class="el-icon-delete"></span> 删除</el-button |
||||
> |
||||
</template> |
||||
</avue-crud></el-tab-pane |
||||
> |
||||
</el-tabs> |
||||
<el-dialog |
||||
:title="alarmTitle" |
||||
v-dialogDrag |
||||
:visible.sync="alarmAdd" |
||||
v-if="alarmAdd" |
||||
class="avue-dialog avue-dialog--top" |
||||
append-to-body |
||||
:close-on-click-modal="false" |
||||
:before-close="handleAlarmClose" |
||||
width="40%" |
||||
> |
||||
<el-form |
||||
:model="ruleForm" |
||||
:rules="rules" |
||||
ref="ruleForm" |
||||
label-width="120px" |
||||
class="demo-ruleForm" |
||||
style="width: 90%" |
||||
> |
||||
<!-- <el-form-item label="iccid" prop="iccid"> |
||||
<el-input |
||||
v-model="ruleForm.iccid" |
||||
size="small" |
||||
placeholder="请输入iccid" |
||||
></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="msisdn" prop="msisdn"> |
||||
<el-input |
||||
v-model="ruleForm.msisdn" |
||||
size="small" |
||||
placeholder="请输入msisdn" |
||||
></el-input> |
||||
</el-form-item> --> |
||||
<el-form-item label="流量卡" prop="simCardId"> |
||||
<el-popover placement="right" trigger="click"> |
||||
<div> |
||||
<el-form |
||||
:inline="true" |
||||
:model="simcardArrPage" |
||||
class="demo-form-inline" |
||||
> |
||||
<el-form-item label="iccid"> |
||||
<el-input |
||||
v-model="simcardArrPage.iccid" |
||||
placeholder="iccid" |
||||
size="small" |
||||
clearable |
||||
></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="msisdn"> |
||||
<el-input |
||||
v-model="simcardArrPage.msisdn" |
||||
placeholder="msisdn" |
||||
size="small" |
||||
clearable |
||||
></el-input> |
||||
</el-form-item> |
||||
<!-- ---流量卡--- --> |
||||
|
||||
<el-form-item> |
||||
<el-button |
||||
type="primary" |
||||
@click="onSubmitsimcard" |
||||
size="small" |
||||
>查询</el-button |
||||
> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
:row-key="rowKey" |
||||
ref="multipleTable" |
||||
:data="simcardArr" |
||||
style="width: 100%" |
||||
@selection-change="handleSelectionChange" |
||||
> |
||||
<el-table-column |
||||
type="selection" |
||||
:reserve-selection="true" |
||||
width="50" |
||||
> |
||||
</el-table-column> |
||||
<el-table-column prop="iccid" label="iccid"> </el-table-column> |
||||
<el-table-column prop="msisdn" label="msisdn"> |
||||
</el-table-column> |
||||
</el-table> |
||||
<el-pagination |
||||
background |
||||
layout="prev, pager, next" |
||||
:total="simcardArrPage.total" |
||||
:page-size="10" |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange" |
||||
style="text-align: center; margin: top 6px" |
||||
> |
||||
</el-pagination> |
||||
</div> |
||||
<el-input |
||||
type="textarea" |
||||
v-model="ruleForm.simCardId" |
||||
:rows="6" |
||||
slot="reference" |
||||
size="small" |
||||
placeholder="请点击选择流量卡" |
||||
readonly="readonly" |
||||
> |
||||
</el-input> |
||||
</el-popover> |
||||
</el-form-item> |
||||
<div class="avue-dialog__footer"> |
||||
<el-button type="primary" size="small" @click="handleAlarmSubmit"> |
||||
<span class="el-icon-circle-plus-outline" /> 保 存 |
||||
</el-button> |
||||
<el-button @click="handleAlarmClose" size="small"> |
||||
<span class="el-icon-circle-close" /> 取 消 |
||||
</el-button> |
||||
</div> |
||||
</el-form> |
||||
</el-dialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
add, |
||||
getDetail, |
||||
getList, |
||||
remove, |
||||
update, |
||||
adds, |
||||
getLists, |
||||
removes, |
||||
updates, |
||||
simcardList, |
||||
} from "@/api/rulemanagement/alarm"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
forms: {}, |
||||
querys: {}, |
||||
loading: true, |
||||
loadings: true, |
||||
alarmAdd: false, //告警范围新增布尔 |
||||
alarmTitle: "新增", //告警范围弹窗标题 |
||||
alarmrangeId: { |
||||
alarmRuleId: "", |
||||
}, //告警规则id |
||||
activeName: "first", |
||||
simcardArr: [], //告警范围弹窗列表 |
||||
simcardArrPage: { |
||||
size: 5, |
||||
current: 1, |
||||
total: "0", |
||||
iccid: "", |
||||
msisdn: "", |
||||
simCardId: "", //流量卡id |
||||
}, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
pages: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
viewBtn: true, |
||||
columnBtn: true, |
||||
addBtn: true, |
||||
dialogClickModal: false, |
||||
dialogWidth: "59%", |
||||
labelWidth: 125, |
||||
column: [ |
||||
{ |
||||
label: "id", |
||||
prop: "id", |
||||
search: false, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
viewDisplay: false, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "id", |
||||
prop: "id", |
||||
search: false, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
viewDisplay: false, |
||||
hide: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "名称", |
||||
prop: "name", |
||||
search: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "监控类型", |
||||
prop: "controlType", |
||||
type: "select", |
||||
search: true, |
||||
dicData: [ |
||||
{ |
||||
label: "流量监控", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "流量池监控", |
||||
value: 2, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择监控类型", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "启用状态", |
||||
prop: "enableStatus", |
||||
type: "select", |
||||
search: false, |
||||
dicData: [ |
||||
{ |
||||
label: "未启用", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "已启用", |
||||
value: 2, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择是否显示", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "通知号码", |
||||
prop: "phoneNum", |
||||
hide: true, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入通知号码", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "接收类型", |
||||
prop: "receiveType", |
||||
type: "select", |
||||
search: false, |
||||
hide: true, |
||||
dicData: [ |
||||
{ |
||||
label: "日间发送", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "全天发送", |
||||
value: 2, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择是否显示", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
{ |
||||
label: "类型", |
||||
prop: "type", |
||||
type: "select", |
||||
search: false, |
||||
hide: true, |
||||
dicData: [ |
||||
{ |
||||
label: "语音", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "短信", |
||||
value: 2, |
||||
}, |
||||
{ |
||||
label: "邮件", |
||||
value: 3, |
||||
}, |
||||
], |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请选择类型", |
||||
trigger: "change", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "第一阈值", |
||||
prop: "firstValue", |
||||
hide: true, |
||||
span: 12, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入第一阈值", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "第二阈值", |
||||
prop: "secondValue", |
||||
hide: true, |
||||
|
||||
rules: [ |
||||
{ |
||||
required: false, |
||||
message: "请输入第二阈值", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "第三阈值", |
||||
prop: "thirdValue", |
||||
hide: true, |
||||
|
||||
rules: [ |
||||
{ |
||||
required: false, |
||||
message: "请输入第三阈值", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
options: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
editBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
columnBtn: true, |
||||
addBtn: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "59%", |
||||
labelWidth: 125, |
||||
column: [ |
||||
{ |
||||
label: "id", |
||||
prop: "id", |
||||
search: false, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
viewDisplay: false, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "simCardId", |
||||
prop: "simCardId", |
||||
search: false, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
viewDisplay: false, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入simCardId", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "iccid", |
||||
prop: "iccid", |
||||
search: false, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
viewDisplay: false, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入iccid", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "msisdn", |
||||
prop: "msisdn", |
||||
search: false, |
||||
addDisplay: false, |
||||
editDisplay: false, |
||||
viewDisplay: false, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入msisdn", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
datas: [], |
||||
|
||||
ruleForm: { |
||||
alarmRuleId: "", //告警规则id |
||||
iccid: "", |
||||
msisdn: "", |
||||
simCardId: "", //流量卡id |
||||
}, |
||||
rules: { |
||||
iccid: [{ required: true, message: "请输入iccid", trigger: "blur" }], |
||||
msisdn: [{ required: true, message: "请输入msisdn", trigger: "blur" }], |
||||
simCardId: [ |
||||
{ required: true, message: "请选择流量卡", trigger: "[change,blur]" }, |
||||
], |
||||
}, |
||||
}; |
||||
}, |
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
add(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
window.console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
//告警规则 |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//告警范围 |
||||
handleAlarmOption(row) { |
||||
this.activeName = "second"; |
||||
this.alarmrangeId.alarmRuleId = row.row.id; |
||||
this.onLoads(this.pages); |
||||
}, |
||||
//告警范围列表 |
||||
onLoads(pages, params = {}) { |
||||
this.loadings = true; |
||||
getLists( |
||||
pages.currentPage, |
||||
pages.pageSize, |
||||
Object.assign(params, this.querys, this.alarmrangeId) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.pages.total = data.total; |
||||
this.datas = data.records; |
||||
this.loadings = false; |
||||
}); |
||||
}, |
||||
|
||||
//告警范围新增弹窗 |
||||
handleAlarmAdd() { |
||||
this.alarmAdd = true; |
||||
|
||||
this.getsimcardList(); |
||||
}, |
||||
//删除 |
||||
handleAlarmDel(row) { |
||||
this.$confirm("确定删除此条数据吗?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return removes(row.row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoads(this.pages); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
//关闭告警范围弹窗 |
||||
handleAlarmClose() { |
||||
this.alarmAdd = false; |
||||
this.$refs.ruleForm.resetFields(); |
||||
this.simcardArrPage.current = 1; |
||||
this.$refs.multipleTable.clearSelection(); |
||||
}, |
||||
//提交告警范围 |
||||
handleAlarmSubmit() { |
||||
this.$refs.ruleForm.validate((valid) => { |
||||
if (valid) { |
||||
adds({ |
||||
alarmRuleId: this.alarmrangeId.alarmRuleId, |
||||
simCardIds: this.ruleForm.simCardId, |
||||
}) |
||||
.then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.$message.success("提交成功"); |
||||
this.alarmAdd = false; |
||||
this.$refs.ruleForm.resetFields(); |
||||
this.onLoads(this.pages); |
||||
this.simcardArrPage.current = 1; |
||||
} else { |
||||
this.$message.error("提交失败"); |
||||
this.alarmAdd = false; |
||||
this.$refs.ruleForm.resetFields(); |
||||
} |
||||
}) |
||||
.catch(() => { |
||||
this.$message.error("提交失败"); |
||||
this.alarmAdd = false; |
||||
this.$refs.ruleForm.resetFields(); |
||||
}); |
||||
} else { |
||||
return false; |
||||
} |
||||
}); |
||||
}, |
||||
//流量卡列表 |
||||
getsimcardList() { |
||||
simcardList({ |
||||
size: this.simcardArrPage.size, |
||||
current: this.simcardArrPage.current, |
||||
iccid: this.simcardArrPage.iccid, |
||||
msisdn: this.simcardArrPage.msisdn, |
||||
alarmRuleId: this.alarmrangeId.alarmRuleId, |
||||
}).then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.simcardArr = res.data.data.records; |
||||
this.simcardArrPage.total = res.data.data.total; |
||||
} |
||||
}); |
||||
}, |
||||
//流量卡列表分页 |
||||
handleSizeChange(val) { |
||||
this.simcardArrPage.size = val; |
||||
this.getsimcardList(); |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.simcardArrPage.current = val; |
||||
this.getsimcardList(); |
||||
}, |
||||
// 流量卡列表搜索 |
||||
onSubmitsimcard() { |
||||
this.getsimcardList(); |
||||
}, |
||||
rowKey(row) { |
||||
return row.id; |
||||
}, |
||||
//流量卡出库模块 |
||||
handleSelectionChange(val) { |
||||
let arr = []; |
||||
val.forEach((res) => { |
||||
arr.push(res.id); |
||||
}); |
||||
this.ruleForm.simCardId = arr.toString(); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.avue-dialog__footer { |
||||
display: flex; |
||||
justify-content: flex-end; |
||||
margin-top: 10px; |
||||
} |
||||
</style> |
Loading…
Reference in new issue