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

Merge remote-tracking branch 'origin/master'

parents 8970f5ba ea7ab5e1
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="utf-8"> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!-- <title><%= process.env.VUE_APP_NAME %></title> --> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title></title> <!-- <title><%= process.env.VUE_APP_NAME %></title> -->
<!-- require cdn assets css --> <title></title>
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> <!-- require cdn assets css -->
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" /> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
<% } %> <% } %>
<style>
</head> @font-face {
<body> font-family: Source Han Sans CN;
<noscript> src: url("./SourceHanSansSC-Regular-2.otf");
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> }
</noscript> </style>
<div id="popContainer"> </head>
<div id="app"></div>
</div> <body>
<!-- require cdn assets js --> <noscript>
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="popContainer">
<div id="app"></div>
</div>
<!-- require cdn assets js -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html>
</html>
\ No newline at end of file
<template>
<div class="y-button" :style="{ '--w': width + 'px' }">
<button
type="button"
:style="{ '--w': width + 'px' }"
:class="{ animating: active, active: value }"
@click="clickHandler"
@animationend="animationend"
>
<span>
<b></b>
<svg viewBox="-5.5 -5.5 71 71" id="circle">
<circle
cx="30"
cy="30"
r="30"
stroke="white"
stroke-width="11"
fill="transparent"
></circle>
</svg>
</span>
</button>
<div :class="['text', { active: value }]">
<!-- <span class="on">
<span>
{{ activeText }}
</span>
</span>
<span class="off">
<span>
{{ unActiveText }}
</span>
</span> -->
{{ value ? activeText : unActiveText }}
</div>
</div>
</template>
<script>
export default {
model: {
prop: "checked",
event: "change",
},
props: {
width: {
type: Number,
default: 84,
},
checked: {
required: true,
},
activeText: {
default: "ON",
},
unActiveText: {
default: "OFF",
},
},
data() {
return {
active: false,
};
},
computed: {
value() {
return this.checked === 1 || this.checked === "1";
},
},
methods: {
clickHandler() {
this.active = true;
},
animationend() {
this.active = false;
this.$emit("change", this.checked ? 0 : 1);
},
},
};
</script>
<style lang="less" scoped>
@keyframes c {
to {
transform: none;
}
}
.y-button {
--timing: cubic-bezier(0.645, 0.045, 0.355, 1);
--primary: #f4f7f5;
width: var(--w);
button {
--bg: rgb(var(--rgb));
--bga: rgba(var(--rgb), 0.4);
/* Safari fix */
-webkit-appearance: none;
border: none;
font-size: 100%;
width: var(--w);
height: var(--w);
background: var(--bg);
box-shadow: 0 3px 12px 2px var(--bga);
border-radius: 50%;
position: relative;
overflow: hidden;
cursor: pointer;
transition: 0.1s transform, 0.3s box-shadow;
will-change: transform, box-shadow;
backface-visibility: hidden;
}
button > * {
pointer-events: none;
}
button:focus {
outline: none;
}
button:active {
transform: scale(0.97);
}
button:after {
--bg: rgb(var(--rgb));
content: "";
position: absolute;
top: -15%;
left: -15%;
width: 200%;
height: 200%;
background: var(--bg);
border-radius: inherit;
transform: translate(5%, 5%) scale(0.03);
pointer-events: none;
}
button.animating:after {
animation: c 0.5s cubic-bezier(0.5, 0, 0.5, 1) backwards;
}
button.active,
button:not(.active):after {
--rgb: 64, 227, 120;
}
button:not(.active),
button.active:after {
--rgb: 229, 55, 94;
}
button span {
display: inline-block;
position: relative;
margin-top: 5px;
}
button b {
--w: 7px;
overflow: hidden;
border-radius: var(--w);
display: grid;
width: var(--w);
height: 35px;
top: 0;
left: 50%;
position: absolute;
transform: translateX(-50%);
z-index: 3;
will-change: transform;
}
button b:before {
content: "";
background: #fff;
width: 100%;
height: 100%;
border-radius: var(--w);
transform: translateY(-15px);
transition-timing-function: var(--timing);
transition: 0.5s;
}
button.active b:before {
transform: translateY(12px);
transition-delay: 0.27s;
transition-timing-function: cubic-bezier(0.25, 0.25, 0.25, 1.25);
}
button svg {
--dash: 190;
stroke-linecap: round;
stroke-dasharray: var(--dash);
stroke-dashoffset: var(--dash);
width: 46px;
height: 46px;
transform: scaleX(-1) rotate(-89deg);
transition: 0.4s;
transition-timing-function: var(--timing);
margin: auto;
position: relative;
z-index: 1;
will-change: transform, stroke-dashoffset;
}
button:not(.active) svg {
stroke-dashoffset: 40;
transform: scaleX(-1) rotate(-52deg);
transition: 0.5s 0.25s;
}
aside {
position: absolute;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
text-align: center;
width: 100%;
padding: 0 2em 2em;
font-family: "Pacifico", cursive;
}
aside a {
text-decoration: underline;
color: #e65289;
display: flex;
align-items: center;
}
aside a:hover,
aside a:focus {
color: #000;
text-decoration: none;
}
.dribbble-logo {
width: 18px;
height: 18px;
margin-right: 5px;
}
.text {
width: 100%;
margin-top: 10px;
font-size: 22px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #c9c9c9;
text-align: center;
}
}
</style>
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
<div class="sitetree"> <div class="sitetree">
<!-- <span style="font-weight: 600">站点结构</span> --> <!-- <span style="font-weight: 600">站点结构</span> -->
<div class="box"> <div class="box">
<a-tree <a-spin :spinning="loading">
:load-data="onLoadData" <a-tree
:tree-data="treeData" :tree-data="treeData"
:expandedKeys.sync="expandedKeys" :expandedKeys.sync="expandedKeys"
:replaceFields="{ title: 'label', key: 'id' }" :replaceFields="{ title: 'label', key: 'id' }"
@select="onSelect" @select="onSelect"
> >
</a-tree> </a-tree>
</a-spin>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
// api // api
import { import {
getListByParentId, getListByParentId,
authAreaTree,
// areaList, // areaList,
// getSiteList // getSiteList
} from "@/services/basicsetFun"; } from "@/services/basicsetFun";
...@@ -28,43 +30,73 @@ export default { ...@@ -28,43 +30,73 @@ export default {
treeData: [], //树结构 treeData: [], //树结构
id: "", id: "",
expandedKeys: [], expandedKeys: [],
loading: false,
}; };
}, },
created() { created() {
this.getAreaList(); this.authAreaTree();
this.getTopArea();
}, },
methods: { methods: {
// 获取区域 editLeaf(arr) {
async getAreaList() { return arr.map((v) => {
if (v.children && v.children.length > 0) {
this.editLeaf(v.children);
} else {
v.isLeaf = true;
}
return v;
});
},
// 获取个人区域数据
async authAreaTree() {
this.loading = true;
let res = await authAreaTree();
if (res.data.code == 1) {
let { data } = res.data.data;
if (data.length) {
let firstData = data[0];
if (firstData.areaLevel > 2 || data.length > 1) {
let TopParent = await this.getTopArea();
TopParent.selectable = false;
TopParent.children = this.editLeaf(data);
this.treeData = [TopParent];
} else {
this.treeData = this.editLeaf(data);
}
this.expandedKeys = [this.treeData[0].id];
}
}
this.loading = false;
},
// 获取顶层区域
async getTopArea() {
let res = await getListByParentId({ parentId: 0 }); let res = await getListByParentId({ parentId: 0 });
const { data, code } = res.data; const { data, code } = res.data;
if (code === 1) { if (code === 1) {
this.treeData = data.data; return data.data[0];
// let obj = { } else {
// dataRef: { return {};
// id: data.data[0].id,
// },
// };
// this.onLoadData(obj);
this.expandedKeys = [data.data[0].id];
} }
}, },
// 异步获取子区域 // 异步获取子区域
onLoadData(treeNode) { // onLoadData(treeNode) {
return new Promise((resolve) => { // return new Promise((resolve) => {
getListByParentId({ // getListByParentId({
parentId: treeNode.dataRef.id, // parentId: treeNode.dataRef.id,
}).then((res) => { // }).then((res) => {
const { data } = res.data; // const { data } = res.data;
treeNode.dataRef.children = data.data; // treeNode.dataRef.children = data.data;
this.treeData = [...this.treeData]; // this.treeData = [...this.treeData];
resolve(); // resolve();
}); // });
}); // });
}, // },
// 选中区域 // 选中区域
onSelect(num, node) { onSelect(num, node) {
if (num && node.selectedNodes.length > 0) { if (num && node.selectedNodes.length > 0) {
...@@ -94,4 +126,4 @@ export default { ...@@ -94,4 +126,4 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -112,7 +112,9 @@ export default { ...@@ -112,7 +112,9 @@ export default {
this.form.id && this.$delete(this.form, "id"); this.form.id && this.$delete(this.form, "id");
}, },
onEdit(data) { onEdit(data) {
this.form = { ...data }; this.$nextTick(() => {
this.form = { ...data };
});
}, },
handleReset() { handleReset() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
...@@ -125,5 +127,4 @@ export default { ...@@ -125,5 +127,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -154,7 +154,9 @@ export default { ...@@ -154,7 +154,9 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.form = { ...data }; this.$nextTick(() => {
this.form = { ...data };
});
}, },
// 关闭对话框 // 关闭对话框
handleClose() { handleClose() {
...@@ -178,4 +180,4 @@ export default { ...@@ -178,4 +180,4 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
</style> </style>
\ No newline at end of file
...@@ -471,7 +471,9 @@ export default { ...@@ -471,7 +471,9 @@ export default {
}; };
}); });
} }
this.form = { ...data }; this.$nextTick(() => {
this.form = { ...data };
});
}, },
// 过滤附件数组 // 过滤附件数组
filterArr(arr, file) { filterArr(arr, file) {
...@@ -525,4 +527,4 @@ export default { ...@@ -525,4 +527,4 @@ export default {
.upload-file { .upload-file {
display: block; display: block;
} }
</style> </style>
\ No newline at end of file
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
}" }"
> >
<a-space size="middle"> <a-space size="middle">
<a-button @click="onClose"> 取消 </a-button> <a-button @click="resetForm"> 重置 </a-button>
<a-button type="primary" @click="onSubmit"> 确定 </a-button> <a-button type="primary" @click="onSubmit"> 确定 </a-button>
</a-space> </a-space>
</div> </div>
...@@ -269,8 +269,14 @@ export default { ...@@ -269,8 +269,14 @@ export default {
onClose() { onClose() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.fileList = []; this.fileList = [];
this.iconFileList = [];
this.Visible = false; this.Visible = false;
}, },
resetForm() {
this.fileList = [];
this.iconFileList = [];
this.$refs.form.resetFields();
},
// 提交 // 提交
onSubmit() { onSubmit() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
...@@ -302,15 +308,6 @@ export default { ...@@ -302,15 +308,6 @@ export default {
}, },
// 上传图标 // 上传图标
handleChangeIcon({ fileList }) { handleChangeIcon({ fileList }) {
// if (info.file.status === "uploading") {
// this.loading = true;
// return;
// }
// if (info.file.status === "done") {
// this.form.appIconPath = info.file.response.url;
// this.loading = false;
// }
this.iconFileList = [...fileList].slice(-1); this.iconFileList = [...fileList].slice(-1);
this.iconFileList = this.iconFileList.map((v) => { this.iconFileList = this.iconFileList.map((v) => {
if (v.response) { if (v.response) {
...@@ -358,25 +355,28 @@ export default { ...@@ -358,25 +355,28 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.form = { ...data }; this.$nextTick(() => {
this.fileList = [ this.form = { ...data };
{ this.fileList = [
uid: "-1", {
name: this.form.fileName, uid: "-1",
status: "done", name: this.form.fileName,
url: this.form.filePath, status: "done",
}, url: this.form.filePath,
]; },
this.iconFileList = [ ];
{ this.iconFileList = [
uid: "-2", {
name: this.form.appIconPath, uid: "-2",
status: "done", name: this.form.appIconPath,
url: this.api2 + this.form.appIconPath, status: "done",
url2: this.form.appIconPath, url: this.api2 + this.form.appIconPath,
}, url2: this.form.appIconPath,
]; },
];
});
}, },
// 选中站点 // 选中站点
changeSite(value, label) { changeSite(value, label) {
this.form.siteName = label[0]; this.form.siteName = label[0];
...@@ -386,6 +386,10 @@ export default { ...@@ -386,6 +386,10 @@ export default {
let val = e.target.value; let val = e.target.value;
if (val == 1) { if (val == 1) {
this.form.url = ""; this.form.url = "";
} else {
this.form.filePath = "";
this.form.fileName = "";
this.fileList = [];
} }
}, },
}, },
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div slot="footer"> <div slot="footer">
<a-button @click="handleCancel">取消</a-button> <a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button> <a-button type="primary" @click="handleOk">确定</a-button>
</div> </div>
</a-modal> </a-modal>
...@@ -259,10 +259,10 @@ export default { ...@@ -259,10 +259,10 @@ export default {
fieldCode: "", // 字段编码 fieldCode: "", // 字段编码
fieldName: "", // 字段名称 fieldName: "", // 字段名称
fieldType: undefined, //字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框) fieldType: undefined, //字段类型(input.单行输入框,textarea.多行输入框,SELECT.下拉选项框,date.日期选择框)
dataType: "", // 数据类型(number.数字,string.字符串) dataType: "string", // 数据类型(number.数字,string.字符串)
fieldLen: 128, //数据长度,默认128 fieldLen: 128, //数据长度,默认128
fieldNull: "", //是否允许为空,(0.否,1.是) fieldNull: 0, //是否允许为空,(0.否,1.是)
isList: "", //字段是否列表显示(0.否,1.是) isList: 0, //字段是否列表显示(0.否,1.是)
fieldOrderNo: 99, // 排序号 fieldOrderNo: 99, // 排序号
fieldTypeValue: "", // 字段类型值 fieldTypeValue: "", // 字段类型值
defaultValue: "", // 字段默认值 defaultValue: "", // 字段默认值
...@@ -363,7 +363,7 @@ export default { ...@@ -363,7 +363,7 @@ export default {
}); });
}, },
handleCancel() { handleCancel() {
this.$refs.form.clearValidate(); this.$refs.form.resetFields();
this.fieldType = [ this.fieldType = [
{ {
key: "", key: "",
...@@ -378,6 +378,21 @@ export default { ...@@ -378,6 +378,21 @@ export default {
]; ];
this.Visible = false; this.Visible = false;
}, },
handleReset() {
this.$refs.form.resetFields();
this.fieldType = [
{
key: "",
value: "",
},
];
this.apiParams = [
{
key: "",
value: "",
},
];
},
// 新增 // 新增
onAdd() { onAdd() {
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
...@@ -387,40 +402,42 @@ export default { ...@@ -387,40 +402,42 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
if (data.fieldTypeValue) { this.$nextTick(() => {
let fieldTypeObj = JSON.parse(data.fieldTypeValue); if (data.fieldTypeValue) {
this.fieldType = Object.keys(fieldTypeObj).map((key) => { let fieldTypeObj = JSON.parse(data.fieldTypeValue);
return { this.fieldType = Object.keys(fieldTypeObj).map((key) => {
key, return {
value: fieldTypeObj[key], key,
}; value: fieldTypeObj[key],
}); };
} else { });
this.fieldType = [ } else {
{ this.fieldType = [
key: "", {
value: "", key: "",
}, value: "",
]; },
} ];
if (data.serviceApiParams) { }
let apiParamsObj = JSON.parse(data.serviceApiParams); if (data.serviceApiParams) {
this.apiParams = Object.keys(apiParamsObj).map((key) => { let apiParamsObj = JSON.parse(data.serviceApiParams);
return { this.apiParams = Object.keys(apiParamsObj).map((key) => {
key, return {
value: apiParamsObj[key], key,
}; value: apiParamsObj[key],
}); };
} else { });
this.apiParams = [ } else {
{ this.apiParams = [
key: "", {
value: "", key: "",
}, value: "",
]; },
} ];
this.form = { ...data }; }
this.getTempleteList(); this.form = { ...data };
this.getTempleteList();
});
}, },
// 添加数据配置行数 // 添加数据配置行数
insertion(index, type) { insertion(index, type) {
......
...@@ -5,13 +5,8 @@ ...@@ -5,13 +5,8 @@
:maskClosable="false" :maskClosable="false"
:title="title" :title="title"
@cancel="handleClose" @cancel="handleClose"
destroyOnClose
centered centered
> >
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<a-form-model <a-form-model
ref="form" ref="form"
:model="form" :model="form"
...@@ -46,6 +41,10 @@ ...@@ -46,6 +41,10 @@
<a-input-number v-model="form.sort" :min="1" /> <a-input-number v-model="form.sort" :min="1" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -110,18 +109,20 @@ export default { ...@@ -110,18 +109,20 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.form = { ...data }; this.$nextTick(() => {
if (this.form.cover) { this.form = { ...data };
this.fileList = [ if (this.form.cover) {
{ this.fileList = [
uid: "-2", {
name: this.form.cover, uid: "-2",
status: "done", name: this.form.cover,
url: this.api2 + this.form.cover, status: "done",
url2: this.form.cover, url: this.api2 + this.form.cover,
}, url2: this.form.cover,
]; },
} ];
}
});
}, },
// 关闭弹窗 // 关闭弹窗
handleClose() { handleClose() {
...@@ -180,6 +181,7 @@ export default { ...@@ -180,6 +181,7 @@ export default {
}, },
// 重置 // 重置
handleReset() { handleReset() {
this.fileList = [];
this.$refs.form.resetFields(); this.$refs.form.resetFields();
}, },
}, },
......
...@@ -157,11 +157,13 @@ export default { ...@@ -157,11 +157,13 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.getBusinessData(); this.$nextTick(() => {
this.form = { ...data }; this.getBusinessData();
if (this.form.parentId == 0) { this.form = { ...data };
this.form.parentId = undefined; if (this.form.parentId == 0) {
} this.form.parentId = undefined;
}
});
}, },
// 切换业务级别 // 切换业务级别
changeIsBusiness() { changeIsBusiness() {
......
...@@ -119,8 +119,10 @@ export default { ...@@ -119,8 +119,10 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data, modelInfo) { onEdit(data, modelInfo) {
this.modelInfo = modelInfo; this.$nextTick(() => {
this.formData = { ...data }; this.modelInfo = modelInfo;
this.formData = { ...data };
});
}, },
// 关闭弹窗 // 关闭弹窗
handleClose() { handleClose() {
...@@ -149,5 +151,4 @@ export default { ...@@ -149,5 +151,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -92,6 +92,12 @@ ...@@ -92,6 +92,12 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button :loading="loading" type="primary" @click="handleOk"
>确定</a-button
>
</div>
</a-modal> </a-modal>
</template> </template>
...@@ -114,6 +120,7 @@ export default { ...@@ -114,6 +120,7 @@ export default {
// } // }
// }; // };
return { return {
loading: false,
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 14 }, wrapperCol: { span: 14 },
siteInfo: { siteInfo: {
...@@ -179,9 +186,11 @@ export default { ...@@ -179,9 +186,11 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.siteInfo.siteName = data.siteName; this.$nextTick(() => {
this.siteInfo.siteId = data.siteId; this.siteInfo.siteName = data.siteName;
this.form = { ...data }; this.siteInfo.siteId = data.siteId;
this.form = { ...data };
});
}, },
// 保存 // 保存
handleOk() { handleOk() {
...@@ -206,6 +215,10 @@ export default { ...@@ -206,6 +215,10 @@ export default {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.Visible = false; this.Visible = false;
}, },
// 重置
resetForm() {
this.$refs.formData.resetFields();
},
}, },
}; };
</script> </script>
...@@ -220,4 +233,4 @@ export default { ...@@ -220,4 +233,4 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<a-modal <a-modal
:title="WindowTitle" :title="WindowTitle"
@ok="handleAdd"
:visible="Visible" :visible="Visible"
@cancel="handleClose" @cancel="handleClose"
:maskClosable="false" :maskClosable="false"
...@@ -188,6 +187,12 @@ ...@@ -188,6 +187,12 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button :loading="loading" type="primary" @click="handleOk"
>确定</a-button
>
</div>
</a-modal> </a-modal>
</template> </template>
...@@ -288,12 +293,14 @@ export default { ...@@ -288,12 +293,14 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.siteInfo.siteName = row.siteName; this.$nextTick(() => {
this.siteInfo.siteId = row.siteId; this.siteInfo.siteName = row.siteName;
this.form = { ...row }; this.siteInfo.siteId = row.siteId;
this.form = { ...row };
});
}, },
// 保存 // 保存
async handleAdd() { async handleOk() {
this.$refs.formData.validate(async (valid) => { this.$refs.formData.validate(async (valid) => {
if (valid) { if (valid) {
let res = await addWindow({ let res = await addWindow({
...@@ -314,6 +321,10 @@ export default { ...@@ -314,6 +321,10 @@ export default {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.Visible = false; this.Visible = false;
}, },
// 重置
resetForm() {
this.$refs.formData.resetFields();
},
// 改变无人值守 // 改变无人值守
changeDuty(val) { changeDuty(val) {
if (!val) { if (!val) {
......
...@@ -59,9 +59,7 @@ ...@@ -59,9 +59,7 @@
</div> </div>
</div> </div>
<div> <div>
<div class="department_span"> <div>简称:{{ v.deptAbb ? v.deptAbb : "--" }}</div>
简称:{{ v.deptAbb ? v.deptAbb : "--" }}
</div>
<div> <div>
联系电话:{{ v.deptTelphone ? v.deptTelphone : "--" }} 联系电话:{{ v.deptTelphone ? v.deptTelphone : "--" }}
</div> </div>
...@@ -687,7 +685,6 @@ export default { ...@@ -687,7 +685,6 @@ export default {
} }
.department_span { .department_span {
margin-right: 3px; margin-right: 3px;
font-size: 5px;
} }
.department_off { .department_off {
// margin-left: 20px; // margin-left: 20px;
......
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
:maskClosable="false" :maskClosable="false"
:title="title" :title="title"
@cancel="handleClose" @cancel="handleClose"
destroyOnClose
> >
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<a-form-model <a-form-model
ref="form" ref="form"
:model="form" :model="form"
...@@ -44,11 +39,15 @@ ...@@ -44,11 +39,15 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import { saveHall } from "@/services/hall"; import { saveHall } from "@/services/hall";
import loacl from "@/utils/local"; import loacl from "@/utils/local";
export default { export default {
...@@ -100,7 +99,9 @@ export default { ...@@ -100,7 +99,9 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.form = { ...data }; this.$nextTick(() => {
this.form = { ...data };
});
}, },
// 关闭弹窗 // 关闭弹窗
handleClose() { handleClose() {
...@@ -128,9 +129,9 @@ export default { ...@@ -128,9 +129,9 @@ export default {
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-input-number { .ant-input-number {
width: 100%; width: 100%;
} }
</style> </style>
\ No newline at end of file
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
:maskClosable="false" :maskClosable="false"
title="新增大厅窗口" title="新增大厅窗口"
@cancel="handleClose" @cancel="handleClose"
destroyOnClose
centered centered
> >
<template slot="footer"> <template slot="footer">
...@@ -96,7 +95,9 @@ export default { ...@@ -96,7 +95,9 @@ export default {
}, },
// 新增 // 新增
onAdd(rows) { onAdd(rows) {
this.windowList = rows; this.$nextTick(() => {
this.windowList = rows;
});
// this.form.windowId = rows.id; // this.form.windowId = rows.id;
// this.form.windowName = rows.name; // this.form.windowName = rows.name;
}, },
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<a-modal <a-modal
:maskClosable="false" :maskClosable="false"
:title="title" :title="title"
@ok="handleOk"
:visible="Visible" :visible="Visible"
@cancel="handleClose" @cancel="handleClose"
> >
...@@ -34,6 +33,12 @@ ...@@ -34,6 +33,12 @@
<a-textarea v-model="form.summary" placeholder allow-clear /> <a-textarea v-model="form.summary" placeholder allow-clear />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button :loading="loading" type="primary" @click="handleOk"
>确定</a-button
>
</div>
</a-modal> </a-modal>
</template> </template>
...@@ -41,8 +46,15 @@ ...@@ -41,8 +46,15 @@
import { addHoliday } from "@/services/festival"; import { addHoliday } from "@/services/festival";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN"; import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
export default { export default {
props: {
visibleDay: {
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
loading: false,
locale, locale,
title: "选择节假日", title: "选择节假日",
date: [], // 日期 date: [], // 日期
...@@ -71,10 +83,15 @@ export default { ...@@ -71,10 +83,15 @@ export default {
}, },
}; };
}, },
props: {
visibleDay: { computed: {
type: Boolean, Visible: {
default: false, get() {
return this.visibleDay;
},
set(val) {
this.$emit("update:visibleDay", val);
},
}, },
}, },
methods: { methods: {
...@@ -82,6 +99,7 @@ export default { ...@@ -82,6 +99,7 @@ export default {
handleOk() { handleOk() {
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
this.loading = true;
let year = new Date(parseInt(this.form.startTime)).getFullYear(); let year = new Date(parseInt(this.form.startTime)).getFullYear();
let res = await addHoliday({ let res = await addHoliday({
...this.form, ...this.form,
...@@ -95,6 +113,7 @@ export default { ...@@ -95,6 +113,7 @@ export default {
this.handleClose(); this.handleClose();
this.$parent.getHolidayData(); this.$parent.getHolidayData();
} }
this.loading = false;
} }
}); });
}, },
...@@ -114,22 +133,19 @@ export default { ...@@ -114,22 +133,19 @@ export default {
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.title = "编辑节假日"; this.title = "编辑节假日";
this.date = [String(data.startTime), String(data.endTime)]; this.$nextTick(() => {
this.form = { ...data }; this.date = [String(data.startTime), String(data.endTime)];
this.form = { ...data };
});
}, },
handleClose() { handleClose() {
this.Visible = false; this.Visible = false;
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}, },
}, // 重置
computed: { resetForm() {
Visible: { this.date = [];
get() { this.$refs.ruleForm.resetFields();
return this.visibleDay;
},
set(val) {
this.$emit("update:visibleDay", val);
},
}, },
}, },
}; };
...@@ -143,4 +159,4 @@ export default { ...@@ -143,4 +159,4 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
</style> </style>
\ No newline at end of file
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item label="区域编号" prop="areaCode"> <a-form-model-item label="区域编号">
<a-input <a-input
v-model="areaInfo.areaCode" v-model="areaInfo.areaCode"
readOnly disabled
type="text" type="text"
placeholder="请输入区域编号" placeholder="请输入区域编号"
/> </a-form-model-item /> </a-form-model-item
...@@ -596,6 +596,7 @@ export default { ...@@ -596,6 +596,7 @@ export default {
//重置 //重置
resetForm() { resetForm() {
this.fileList = []; this.fileList = [];
this.cityData = [];
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}, },
// 关闭对话框 // 关闭对话框
...@@ -612,31 +613,33 @@ export default { ...@@ -612,31 +613,33 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.formInfo = { ...data }; this.$nextTick(() => {
this.areaInfo.areaID = this.formInfo.areaID; this.formInfo = { ...data };
this.areaInfo.areaCode = this.formInfo.areaCode; this.areaInfo.areaID = this.formInfo.areaID;
this.areaInfo.areaName = this.formInfo.areaName; this.areaInfo.areaCode = this.formInfo.areaCode;
this.cityData = [ this.areaInfo.areaName = this.formInfo.areaName;
this.formInfo.proCode, this.cityData = [
this.formInfo.cityCode, this.formInfo.proCode,
this.formInfo.districtCode, this.formInfo.cityCode,
]; this.formInfo.districtCode,
this.formInfo.modelIds = this.formInfo.modelIds.map(Number);
this.formInfo.amWorkStartTime = String(this.formInfo.amWorkStartTime);
this.formInfo.amWorkEndTime = String(this.formInfo.amWorkEndTime);
this.formInfo.pmWorkStartTime = String(this.formInfo.pmWorkStartTime);
this.formInfo.pmWorkEndTime = String(this.formInfo.pmWorkEndTime);
if (this.formInfo.logoPath) {
this.fileList = [
{
uid: -1,
status: "done",
name: this.formInfo.logoPath,
url: this.api2 + this.formInfo.logoPath,
url2: this.formInfo.logoPath,
},
]; ];
} this.formInfo.modelIds = this.formInfo.modelIds.map(Number);
this.formInfo.amWorkStartTime = String(this.formInfo.amWorkStartTime);
this.formInfo.amWorkEndTime = String(this.formInfo.amWorkEndTime);
this.formInfo.pmWorkStartTime = String(this.formInfo.pmWorkStartTime);
this.formInfo.pmWorkEndTime = String(this.formInfo.pmWorkEndTime);
if (this.formInfo.logoPath) {
this.fileList = [
{
uid: -1,
status: "done",
name: this.formInfo.logoPath,
url: this.api2 + this.formInfo.logoPath,
url2: this.formInfo.logoPath,
},
];
}
});
}, },
// 保存 // 保存
handleOk() { handleOk() {
...@@ -729,8 +732,10 @@ export default { ...@@ -729,8 +732,10 @@ export default {
}) })
.then((res) => { .then((res) => {
let { location } = res.geocodes[0]; let { location } = res.geocodes[0];
[this.formInfo.longitude, this.formInfo.latitude] = [
location.split(","); this.formInfo.longitude,
this.formInfo.latitude,
] = location.split(",");
}) })
.catch(() => { .catch(() => {
this.$message.error("经纬度获取失败,请输入正确的地址"); this.$message.error("经纬度获取失败,请输入正确的地址");
......
<template> <template>
<div class="configurat"> <div class="configurat">
<div class="title">短信全局配置</div> <div class="title">短信全局配置</div>
<div class="set-configurat"> <div class="des">
<y-switch 全局配置,一键控制
v-model="setInfo.messageoff"
checkedChildren="开"
unCheckedChildren="关"
@change="changeClose"
></y-switch>
</div> </div>
<div class="des">
轻松管理政务短信通知的全局设置,确保信息的准确传递
</div>
<div class="tag-list">
<div class="tag-item" v-for="v in tagList" :key="v">
{{ v }}
</div>
</div>
<YButton v-model="setInfo.messageoff" @change="changeClose"></YButton>
</div> </div>
</template> </template>
<script> <script>
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YButton from "@/components/YButton";
import { getSmssetList, saveSmssetList } from "@/services/configurat"; import { getSmssetList, saveSmssetList } from "@/services/configurat";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
components: { components: {
YSwitch, YButton,
}, },
data() { data() {
return { return {
tagList: ["全局管控", "精准到达", "远程监管", "贴心服务"],
setInfo: { setInfo: {
siteId: local.getLocal("siteId"), siteId: local.getLocal("siteId"),
messageoff: "", messageoff: "",
...@@ -53,6 +58,8 @@ export default { ...@@ -53,6 +58,8 @@ export default {
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
} else {
this.getSmssetList();
} }
}, },
}, },
...@@ -63,37 +70,42 @@ export default { ...@@ -63,37 +70,42 @@ export default {
.configurat { .configurat {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 20px; padding: 115px 80px;
.main { background: url("~@/assets/img/sms_bg.jpg") no-repeat center/100% 100%;
height: 100%;
display: flex;
.set-configurat {
margin-left: 20px;
}
.left {
width: 224px;
margin-right: 20px;
}
.right {
height: 200px;
padding: 15px;
flex: 1;
background-color: #fff;
}
}
.title { .title {
margin-left: 15px; margin-bottom: 35px;
position: relative; font-size: 44px;
margin-bottom: 15px; font-family: Source Han Sans CN;
&::before { font-weight: bold;
content: ""; color: #0857e8;
width: 4px; }
height: 20px; .des {
position: absolute; font-size: 20px;
top: 1px; font-family: Source Han Sans CN;
left: -16px; font-weight: 500;
background-color: rgba(5, 149, 253, 1); color: #365182;
line-height: 35px;
}
.tag-list {
margin-top: 38px;
margin-bottom: 40px;
display: flex;
align-items: center;
gap: 26px;
.tag-item {
width: 138px;
height: 50px;
background: rgba(8, 87, 232, 0.05);
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #232323;
} }
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div> <div>
<a-modal <a-modal v-model="Visible" :title="title" @cancel="handleClose">
v-model="Visible"
:title="title"
@ok="handleOk"
@cancel="handleClose"
>
<a-form-model <a-form-model
:model="form" :model="form"
ref="form" ref="form"
...@@ -27,6 +22,10 @@ ...@@ -27,6 +22,10 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</div>
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -89,9 +88,12 @@ export default { ...@@ -89,9 +88,12 @@ export default {
}, },
// 关闭对话框 // 关闭对话框
handleClose() { handleClose() {
this.$refs.form.clearValidate(); this.$refs.form.resetFields();
this.Visible = false; this.Visible = false;
}, },
resetForm() {
this.$refs.form.resetFields();
},
// 新增 // 新增
onAdd() { onAdd() {
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
...@@ -99,7 +101,9 @@ export default { ...@@ -99,7 +101,9 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.form = { ...row }; setTimeout(() => {
this.form = { ...row };
}, 10);
}, },
}, },
}; };
...@@ -114,4 +118,4 @@ export default { ...@@ -114,4 +118,4 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div> <div>
<a-modal <a-modal v-model="Visible" :title="titleField" @cancel="handleClose">
v-model="Visible"
:title="titleField"
@ok="handleOk"
@cancel="handleClose"
>
<a-form-model <a-form-model
:model="formData" :model="formData"
ref="formData" ref="formData"
...@@ -54,6 +49,10 @@ ...@@ -54,6 +49,10 @@
<a-input-number v-model="formData.fieldOrderNo" :min="0" /> <a-input-number v-model="formData.fieldOrderNo" :min="0" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</div>
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -152,7 +151,10 @@ export default { ...@@ -152,7 +151,10 @@ export default {
}); });
}, },
handleClose() { handleClose() {
this.$refs.formData.resetFields();
this.Visible = false; this.Visible = false;
},
resetForm() {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
}, },
changeTemplate(val, e) { changeTemplate(val, e) {
...@@ -166,7 +168,9 @@ export default { ...@@ -166,7 +168,9 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.formData = { ...row }; this.$nextTick(() => {
this.formData = { ...row };
});
}, },
}, },
}; };
...@@ -181,4 +185,4 @@ export default { ...@@ -181,4 +185,4 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div> <div>
<a-modal <a-modal v-model="Visible" :title="titleTemplate" @cancel="handleClose">
v-model="Visible"
:title="titleTemplate"
@ok="handleOk"
@cancel="handleClose"
>
<a-form-model <a-form-model
:model="formData" :model="formData"
ref="formData" ref="formData"
...@@ -31,6 +26,10 @@ ...@@ -31,6 +26,10 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</div>
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -108,8 +107,8 @@ export default { ...@@ -108,8 +107,8 @@ export default {
this.formData.productName = text; this.formData.productName = text;
}, },
handleClose() { handleClose() {
this.Visible = false;
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.Visible = false;
}, },
// 新增 // 新增
onAdd() { onAdd() {
...@@ -118,8 +117,12 @@ export default { ...@@ -118,8 +117,12 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.formData = { ...row }; this.$nextTick(() => {
console.log(row); this.formData = { ...row };
});
},
resetForm() {
this.$refs.formData.resetFields();
}, },
handleOk() { handleOk() {
this.$refs.formData.validate(async (valid) => { this.$refs.formData.validate(async (valid) => {
...@@ -161,4 +164,4 @@ export default { ...@@ -161,4 +164,4 @@ export default {
margin-right: 4px; margin-right: 4px;
margin-bottom: 4px; margin-bottom: 4px;
} }
</style> </style>
\ No newline at end of file
...@@ -148,7 +148,9 @@ export default { ...@@ -148,7 +148,9 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.form = { ...row }; this.$nextTick(() => {
this.form = { ...row };
});
}, },
// 保存 // 保存
handleOk() { handleOk() {
...@@ -168,5 +170,4 @@ export default { ...@@ -168,5 +170,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -209,7 +209,9 @@ export default { ...@@ -209,7 +209,9 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.form = { ...row }; this.$nextTick(() => {
this.form = { ...row };
});
}, },
// 保存 // 保存
handleOk() { handleOk() {
...@@ -229,5 +231,4 @@ export default { ...@@ -229,5 +231,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -527,22 +527,26 @@ export default { ...@@ -527,22 +527,26 @@ export default {
}, },
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
// this.editWindow(data.deptId); this.$nextTick(() => {
this.form = { ...data }; // this.editWindow(data.deptId);
this.form.loginName && this.$delete(this.form, "loginName"); this.form = { ...data };
this.form.loginPwd && this.$delete(this.form, "loginPwd"); this.form.loginName && this.$delete(this.form, "loginName");
this.form.windowId = this.form.windowId ? this.form.windowId : undefined; this.form.loginPwd && this.$delete(this.form, "loginPwd");
if (this.form.photoPath) { this.form.windowId = this.form.windowId
this.fileList = [ ? this.form.windowId
{ : undefined;
uid: -1, if (this.form.photoPath) {
status: "done", this.fileList = [
name: this.form.photoPath, {
url: this.api2 + this.form.photoPath, uid: -1,
url2: this.form.photoPath, status: "done",
}, name: this.form.photoPath,
]; url: this.api2 + this.form.photoPath,
} url2: this.form.photoPath,
},
];
}
});
}, },
// 关闭对话框 // 关闭对话框
handleClose() { handleClose() {
...@@ -556,6 +560,7 @@ export default { ...@@ -556,6 +560,7 @@ export default {
// 重置 // 重置
handleReset() { handleReset() {
// this.form.windowName = ""; // this.form.windowName = "";
this.fileList = [];
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
}, },
// 照片上传 // 照片上传
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
:label-col="{ span: 5 }" :label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }" :wrapper-col="{ span: 19 }"
> >
<a-form-model-item label="账号" prop="loginName"> <a-form-model-item label="账号">
<a-input disabled placeholder="请输入账号" v-model="form.loginName" /> <a-input disabled placeholder="请输入账号" v-model="form.loginName" />
</a-form-model-item> </a-form-model-item>
<!-- <a-form-model-item label="旧密码" prop="oldPwd"> <!-- <a-form-model-item label="旧密码" prop="oldPwd">
...@@ -115,12 +115,15 @@ export default { ...@@ -115,12 +115,15 @@ export default {
}, },
// 关闭对话框 // 关闭对话框
handleClose() { handleClose() {
this.form.loginName = "";
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.Visible = false; this.Visible = false;
}, },
// 获取用户账号信息 // 获取用户账号信息
getUserInfo(account) { getUserInfo(account) {
this.form.loginName = account; this.$nextTick(() => {
this.form.loginName = account;
});
}, },
}, },
}; };
...@@ -135,4 +138,4 @@ export default { ...@@ -135,4 +138,4 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
</style> </style>
\ No newline at end of file
...@@ -30,7 +30,8 @@ module.exports = { ...@@ -30,7 +30,8 @@ module.exports = {
treeselect: `${BASE_URL}/base/area/treeselect`, treeselect: `${BASE_URL}/base/area/treeselect`,
save: `${BASE_URL}/base/area/save`, save: `${BASE_URL}/base/area/save`,
delete: `${BASE_URL}/base/area/delete`, delete: `${BASE_URL}/base/area/delete`,
init: `${BASE_URL}/base/base/area/genSubAreaByAreaName `, init: `${BASE_URL}/base/area/genSubAreaByAreaName`,
authAreaTree: `${BASE_URL}/base/area/authAreaTree`,
}, },
// 站点 // 站点
site: { site: {
......
...@@ -19,6 +19,10 @@ export async function getListByParentId(data) { ...@@ -19,6 +19,10 @@ export async function getListByParentId(data) {
export async function treeselect(data) { export async function treeselect(data) {
return request(area.treeselect, METHOD.POST, data); return request(area.treeselect, METHOD.POST, data);
} }
// 查看个人区域列表
export async function authAreaTree(data) {
return request(area.authAreaTree, METHOD.POST, data);
}
// 查看站点列表 // 查看站点列表
export async function getSiteList(data) { export async function getSiteList(data) {
return request(site.list, METHOD.POST, data); return request(site.list, METHOD.POST, data);
......
...@@ -20,3 +20,7 @@ export function changePassword(params) { ...@@ -20,3 +20,7 @@ export function changePassword(params) {
export function editPassword(params) { export function editPassword(params) {
return http.post(`${baseURL}/zwfw/user/reset/password`, params); return http.post(`${baseURL}/zwfw/user/reset/password`, params);
} }
// 密码过期修改密码
export function changeForgotPassword(params) {
return http.post(`${baseURL}/zwfw/user/forgot/password`, params);
}
...@@ -59,7 +59,7 @@ axios.interceptors.response.use( ...@@ -59,7 +59,7 @@ axios.interceptors.response.use(
message.error({ message.error({
content: msg, content: msg,
maxCount: 1, maxCount: 1,
duration: 1, duration: 2,
}); });
store.commit("user/reset"); store.commit("user/reset");
router.push("/"); router.push("/");
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
></Details> ></Details>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapState } from "vuex";
import storage from "@/utils/js/Storage"; import storage from "@/utils/js/Storage";
...@@ -346,10 +346,14 @@ export default { ...@@ -346,10 +346,14 @@ export default {
for (let item of data) { for (let item of data) {
item.status = this.statusItem[item.status]; item.status = this.statusItem[item.status];
} }
let newData = data.map((v) => {
v.people && delete v.people.id;
return { ...v, ...v.people };
});
export2Excel( export2Excel(
this.tHeader, this.tHeader,
this.filterVal, this.filterVal,
data, newData,
"预约记录报表" + this.$moment().format("YYYYMMDDHHmmss") "预约记录报表" + this.$moment().format("YYYYMMDDHHmmss")
); );
}); });
...@@ -394,6 +398,5 @@ export default { ...@@ -394,6 +398,5 @@ export default {
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -5,102 +5,262 @@ ...@@ -5,102 +5,262 @@
<p class="slogan-text slogan-text-1 mb-12">长江第一城</p> <p class="slogan-text slogan-text-1 mb-12">长江第一城</p>
<p class="slogan-text slogan-text-2">巴蜀醉宜宾</p> <p class="slogan-text slogan-text-2">巴蜀醉宜宾</p>
</div> </div>
<div class="login-box"> <div class="w-[490px] h-[660px]">
<img class="w-[74px] mb-[20px]" src="@/assets/images/logo.png" /> <div class="swiper mySwiper">
<p class="login-text text-[40px] mb-[20px]">欢迎登录!</p> <div class="swiper-wrapper">
<p class="login-text text-[32px] mb-[30px]"> <div class="swiper-slide">
{{ sysName }} <!-- 登录框 -->
</p> <div class="login-box">
<a-form-model <img
:model="form" class="w-[74px] mb-[20px]"
ref="form" src="@/assets/images/logo.png"
:rules="rules" />
:label-col="labelCol" <p class="login-text text-[40px] mb-[20px]">欢迎登录!</p>
:wrapper-col="wrapperCol" <p class="login-text text-[32px] mb-[30px]">
> {{ sysName }}
<a-form-model-item prop="loginName"> </p>
<a-input <a-form-model
placeholder="请输入用户名" :model="form"
v-model="form.loginName" ref="form"
@pressEnter="handleSubmit" :rules="rules"
> :label-col="labelCol"
<img slot="prefix" src="@/assets/images/icon-user.png" /> :wrapper-col="wrapperCol"
<img >
slot="suffix" <a-form-model-item prop="loginName">
v-show="form.loginName" <a-input
class="cursor-pointer" placeholder="请输入用户名"
@click="form.loginName = ''" v-model="form.loginName"
src="@/assets/images/icon-close.png" @pressEnter="handleSubmit"
/> >
</a-input> <img slot="prefix" src="@/assets/images/icon-user.png" />
</a-form-model-item> <img
<a-form-model-item prop="password"> slot="suffix"
<a-input v-show="form.loginName"
placeholder="请输入密码" class="cursor-pointer"
:type="iptType" @click="form.loginName = ''"
v-model="form.password" src="@/assets/images/icon-close.png"
@pressEnter="handleSubmit" />
> </a-input>
<img slot="prefix" src="@/assets/images/icon-user.png" /> </a-form-model-item>
<template slot="suffix"> <a-form-model-item prop="password">
<a-space> <a-input
<img placeholder="请输入密码"
v-show="form.password" :type="TypeForm.iptType"
class="cursor-pointer" v-model="form.password"
@click="form.password = ''" @pressEnter="handleSubmit"
src="@/assets/images/icon-close.png" >
/> <img slot="prefix" src="@/assets/images/icon-user.png" />
<i <template slot="suffix">
v-if="iptType == 'password'" <a-space>
class="iconfont icon-hidden cursor-pointer" <img
@click="iptType = 'text'" v-show="form.password"
></i> class="cursor-pointer"
<i @click="form.password = ''"
v-else src="@/assets/images/icon-close.png"
class="iconfont icon-show cursor-pointer" />
@click="iptType = 'password'" <i
></i> v-if="TypeForm.iptType == 'password'"
</a-space> class="iconfont icon-hidden cursor-pointer"
</template> @click="TypeForm.iptType = 'text'"
</a-input> ></i>
</a-form-model-item> <i
<a-form-model-item class="code" prop="securityCode"> v-else
<a-input class="iconfont icon-show cursor-pointer"
placeholder="请输入验证码" @click="TypeForm.iptType = 'password'"
v-model="form.securityCode" ></i>
@pressEnter="handleSubmit" </a-space>
> </template>
<img </a-input>
slot="suffix" </a-form-model-item>
v-show="form.securityCode" <a-form-model-item class="code" prop="securityCode">
class="cursor-pointer" <a-input
@click="form.securityCode = ''" placeholder="请输入验证码"
src="@/assets/images/icon-close.png" v-model="form.securityCode"
/> @pressEnter="handleSubmit"
</a-input> >
<div class="code-box"> <img
<img :src="imgCode" @click="createCode" /> slot="suffix"
v-show="form.securityCode"
class="cursor-pointer"
@click="form.securityCode = ''"
src="@/assets/images/icon-close.png"
/>
</a-input>
<div class="code-box">
<img :src="imgCode" @click="createCode" />
</div>
</a-form-model-item>
<a-form-model-item>
<a-button
:loading="loading"
class="login-btn"
@click="handleSubmit"
>登录</a-button
>
</a-form-model-item>
</a-form-model>
</div>
</div> </div>
</a-form-model-item> <div class="swiper-slide">
<a-form-model-item> <!-- 修改密码框 -->
<a-button :loading="loading" class="login-btn" @click="handleSubmit" <div class="revamp-box">
>登录</a-button <img
> class="w-[74px] mb-[20px]"
</a-form-model-item> src="@/assets/images/logo.png"
</a-form-model> />
<p class="login-text text-[40px] mb-[20px]">请修改密码</p>
<p class="login-text text-[32px] mb-[30px]">
密码有效期为三个月
</p>
<a-form-model
:model="changePwdForm"
ref="changePwdForm"
:rules="PwdFormRules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item prop="loginName">
<a-input
placeholder="请输入用户名"
v-model="changePwdForm.loginName"
@pressEnter="changePwd"
>
<img slot="prefix" src="@/assets/images/icon-user.png" />
<img
slot="suffix"
v-show="changePwdForm.loginName"
class="cursor-pointer"
@click="changePwdForm.loginName = ''"
src="@/assets/images/icon-close.png"
/>
</a-input>
</a-form-model-item>
<a-form-model-item prop="oldPwd">
<a-input
placeholder="请输入原密码"
:type="TypeForm.oldType"
v-model="changePwdForm.oldPwd"
@pressEnter="changePwd"
>
<img slot="prefix" src="@/assets/images/icon-user.png" />
<template slot="suffix">
<a-space>
<img
v-show="changePwdForm.oldPwd"
class="cursor-pointer"
@click="changePwdForm.oldPwd = ''"
src="@/assets/images/icon-close.png"
/>
<i
v-if="TypeForm.oldType == 'password'"
class="iconfont icon-hidden cursor-pointer"
@click="TypeForm.oldType = 'text'"
></i>
<i
v-else
class="iconfont icon-show cursor-pointer"
@click="TypeForm.oldType = 'password'"
></i>
</a-space>
</template>
</a-input>
</a-form-model-item>
<a-form-model-item prop="newPwd">
<a-input
placeholder="请输入新密码"
:type="TypeForm.newType"
v-model="changePwdForm.newPwd"
@pressEnter="changePwd"
>
<img slot="prefix" src="@/assets/images/icon-user.png" />
<template slot="suffix">
<a-space>
<img
v-show="changePwdForm.newPwd"
class="cursor-pointer"
@click="changePwdForm.newPwd = ''"
src="@/assets/images/icon-close.png"
/>
<i
v-if="TypeForm.newType == 'password'"
class="iconfont icon-hidden cursor-pointer"
@click="TypeForm.newType = 'text'"
></i>
<i
v-else
class="iconfont icon-show cursor-pointer"
@click="TypeForm.newType = 'password'"
></i>
</a-space>
</template>
</a-input>
</a-form-model-item>
<a-form-model-item prop="newPwdAgain">
<a-input
placeholder="请再次输入新密码"
:type="TypeForm.newAgainType"
v-model="changePwdForm.newPwdAgain"
@pressEnter="changePwd"
>
<img slot="prefix" src="@/assets/images/icon-user.png" />
<template slot="suffix">
<a-space>
<img
v-show="changePwdForm.newPwdAgain"
class="cursor-pointer"
@click="changePwdForm.newPwdAgain = ''"
src="@/assets/images/icon-close.png"
/>
<i
v-if="TypeForm.newAgainType == 'password'"
class="iconfont icon-hidden cursor-pointer"
@click="TypeForm.newAgainType = 'text'"
></i>
<i
v-else
class="iconfont icon-show cursor-pointer"
@click="TypeForm.newAgainType = 'password'"
></i>
</a-space>
</template>
</a-input>
</a-form-model-item>
<a-form-model-item>
<a-button
:loading="changeloading"
class="login-btn"
@click="changePwd"
>确认</a-button
>
</a-form-model-item>
</a-form-model>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { LoginInterface } from "@/api/user.js"; import Swiper from "swiper";
import { LoginInterface, changeForgotPassword } from "@/api/user.js";
import { mapMutations, mapState } from "vuex"; import { mapMutations, mapState } from "vuex";
import { changeAccount } from "@/utils/js/validate"; import { changeAccount, changePassWord } from "@/utils/js/validate";
import { encrypt } from "@/utils"; import { encrypt } from "@/utils";
import storage from "@/utils/js/Storage"; import storage from "@/utils/js/Storage";
export default { export default {
data() { data() {
const changePwdAgain = (rule, value, callback) => {
if (!value) {
callback(new Error("请再次输入密码"));
} else if (value !== this.changePwdForm.newPwd) {
callback(new Error("两次密码输入不一致"));
} else {
callback();
}
};
return { return {
sysName: process.env.VUE_APP_systemName, sysName: process.env.VUE_APP_systemName,
labelCol: { span: 0 }, labelCol: { span: 0 },
...@@ -108,7 +268,13 @@ export default { ...@@ -108,7 +268,13 @@ export default {
api: process.env.VUE_APP_API_BASE_URL, api: process.env.VUE_APP_API_BASE_URL,
loading: false, loading: false,
imgCode: "", imgCode: "",
iptType: "password", changeloading: false,
TypeForm: {
iptType: "password", // 登录密码输入框切换
oldType: "password", // 原密码输入框切换
newType: "password", // 新密码输入框切换
newAgainType: "password", // 再次输入新密码输入框切换
},
form: { form: {
loginName: "", loginName: "",
password: "", password: "",
...@@ -116,6 +282,12 @@ export default { ...@@ -116,6 +282,12 @@ export default {
mark: "", mark: "",
type: 2, type: 2,
}, },
changePwdForm: {
loginName: "",
oldPwd: "", // 原密码
newPwd: "", // 新密码
newPwdAgain: "", // 新密码
},
rules: { rules: {
loginName: [ loginName: [
{ required: true, validator: changeAccount, trigger: "blur" }, { required: true, validator: changeAccount, trigger: "blur" },
...@@ -125,6 +297,20 @@ export default { ...@@ -125,6 +297,20 @@ export default {
{ required: true, message: "请输入验证码", trigger: "blur" }, { required: true, message: "请输入验证码", trigger: "blur" },
], ],
}, },
PwdFormRules: {
loginName: [
{ required: true, validator: changeAccount, trigger: "blur" },
],
oldPwd: [
{ required: true, validator: changePassWord, trigger: "blur" },
],
newPwd: [
{ required: true, validator: changePassWord, trigger: "blur" },
],
newPwdAgain: [
{ required: true, validator: changePwdAgain, trigger: "blur" },
],
},
}; };
}, },
computed: { computed: {
...@@ -136,8 +322,38 @@ export default { ...@@ -136,8 +322,38 @@ export default {
} }
this.createCode(); this.createCode();
}, },
mounted() {
this.initSwiper();
},
methods: { methods: {
...mapMutations("user", ["set_token", "SET_USERDATA", "set_siteList"]), ...mapMutations("user", ["set_token", "SET_USERDATA", "set_siteList"]),
initSwiper() {
this.mySwiper = new Swiper(".mySwiper", {
effect: "cube", // 方块动画
speed: 1000, // 时长
// simulateTouch: false, //是否允许鼠标滑动切换
grabCursor: false, // 手形鼠标
cubeEffect: {
shadow: false, // 取消盒子阴影
slideShadows: false, // 取消子项拖动时候的阴影
// shadowOffset: 20,
// shadowScale: 0.94,
},
on: {
slideChange: () => {
// 初始化密码框类型
Object.assign(this.TypeForm, this.$options.data().TypeForm);
this.loading = false;
this.changeloading = false;
this.$refs.changePwdForm.resetFields();
this.$refs.form.resetFields();
this.createCode();
},
},
});
this.mySwiper.init();
},
// 获取验证码 // 获取验证码
createCode() { createCode() {
// 加时间戳印记用于刷新gif // 加时间戳印记用于刷新gif
...@@ -155,7 +371,7 @@ export default { ...@@ -155,7 +371,7 @@ export default {
loginName: encrypt(this.form.loginName), loginName: encrypt(this.form.loginName),
password: encrypt(this.form.password), password: encrypt(this.form.password),
}); });
let { code, data } = res; let { code, data, msg } = res;
if (code == 1) { if (code == 1) {
let { siteList, user, token } = data; let { siteList, user, token } = data;
this.set_token(token); this.set_token(token);
...@@ -168,6 +384,11 @@ export default { ...@@ -168,6 +384,11 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$router.push("/home"); this.$router.push("/home");
}, 20); }, 20);
} else if (code == 99998) {
this.$message.error(msg);
setTimeout(() => {
this.mySwiper.slideTo(1);
}, 500);
} else { } else {
this.createCode(); this.createCode();
} }
...@@ -175,6 +396,29 @@ export default { ...@@ -175,6 +396,29 @@ export default {
} }
}); });
}, },
// 修改密码
changePwd() {
this.$refs.changePwdForm.validate(async (valid) => {
if (valid) {
this.changeloading = true;
let obj = {
loginName: this.changePwdForm.loginName,
oldPwd: encrypt(this.changePwdForm.oldPwd),
newPwd: encrypt(this.changePwdForm.newPwd),
};
let res = await changeForgotPassword(obj);
this.changeloading = false;
let { msg, code } = res;
if (code == 1) {
this.$message.success(msg);
setTimeout(() => {
this.mySwiper.slideTo(0);
}, 500);
}
}
});
},
}, },
}; };
</script> </script>
...@@ -243,9 +487,14 @@ export default { ...@@ -243,9 +487,14 @@ export default {
margin-left: 1em; margin-left: 1em;
animation: var(--time) printText var(--time) steps(5) both; animation: var(--time) printText var(--time) steps(5) both;
} }
.login-box { .swiper {
width: 490px; width: 100%;
height: 660px; height: 100%;
}
.login-box,
.revamp-box {
width: 100%;
height: 100%;
padding: 60px 34px; padding: 60px 34px;
background: url("@/assets/images/login_box_bg.png") center; background: url("@/assets/images/login_box_bg.png") center;
background-size: 100% 100%; background-size: 100% 100%;
...@@ -324,4 +573,4 @@ export default { ...@@ -324,4 +573,4 @@ export default {
color: #ffffff; color: #ffffff;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<a-modal <a-modal
:title="formTitle" :title="formTitle"
:centered="true" :centered="true"
:destroyOnClose="true"
:getContainer="() => $refs.EditModal_box" :getContainer="() => $refs.EditModal_box"
:visible="visible" :visible="visible"
:confirmLoading="EditModalLoading" :confirmLoading="EditModalLoading"
...@@ -117,7 +116,7 @@ ...@@ -117,7 +116,7 @@
@change="handleChangeFile" @change="handleChangeFile"
accept="image/jpeg,image/png" accept="image/jpeg,image/png"
> >
<a-button type="primary" class="addclass" > <a-button type="primary" class="addclass">
<a-icon type="upload" /> 选择文件 <a-icon type="upload" /> 选择文件
</a-button> </a-button>
</a-upload> </a-upload>
...@@ -141,7 +140,9 @@ ...@@ -141,7 +140,9 @@
</a-form-model> </a-form-model>
<template slot="footer"> <template slot="footer">
<a-button @click="resetForm">重置</a-button> <a-button @click="resetForm">重置</a-button>
<a-button type="primary" class="addclass" @click="Modal_Ok">确定</a-button> <a-button type="primary" class="addclass" @click="Modal_Ok"
>确定</a-button
>
</template> </template>
</a-modal> </a-modal>
</div> </div>
...@@ -340,6 +341,7 @@ export default { ...@@ -340,6 +341,7 @@ export default {
// 重置还原表单信息内容 // 重置还原表单信息内容
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.compileInfoForm.resetFields(); this.$refs.compileInfoForm.resetFields();
this.fileList = [];
}); });
}, },
// 新增 // 新增
...@@ -351,15 +353,17 @@ export default { ...@@ -351,15 +353,17 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.compileInfoForm = { ...row }; setTimeout(() => {
this.fileList = [ this.compileInfoForm = { ...row };
{ this.fileList = [
uid: -1, {
name: this.compileInfoForm.imgPath, uid: -1,
url: this.compileInfoForm.imgPath, name: this.compileInfoForm.imgPath,
status: "done", url: this.compileInfoForm.imgPath,
}, status: "done",
]; },
];
}, 10);
}, },
// 关闭弹窗 // 关闭弹窗
handleClose() { handleClose() {
...@@ -379,4 +383,4 @@ export default { ...@@ -379,4 +383,4 @@ export default {
overflow-y: auto !important; overflow-y: auto !important;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="authorityMis"> <div class="authorityMis">
<div class="header_box"> <div class="header_box">
<!-- <button class="addRoles_btn" @click="showRoleEditModal(false)">
<span>新增角色</span>
</button> -->
<a-button <a-button
type="primary" type="primary"
class="addclass" class="addclass"
...@@ -18,11 +15,6 @@ ...@@ -18,11 +15,6 @@
v-model="searchRoleName" v-model="searchRoleName"
@search="getRoleList" @search="getRoleList"
/> />
<!-- <a-input v-model="searchRoleName" placeholder="请输入角色名称搜索">
<a-icon slot="prefix" type="search" />
</a-input> -->
<!-- <button class="search_btn" @click="getRoleList">搜索</button> -->
<!-- <a-button type="primary" class="addclass" @click="getRoleList">搜索</a-button> -->
</span> </span>
</div> </div>
<div class="main"> <div class="main">
...@@ -57,7 +49,6 @@ ...@@ -57,7 +49,6 @@
</a-table> </a-table>
<AddEditRole <AddEditRole
ref="AddEditRole" ref="AddEditRole"
:sourceInfoForm="sourceInfoForm"
:formTitle="formTitle" :formTitle="formTitle"
:roleDict="roleDict" :roleDict="roleDict"
@getRoleList="getRoleList" @getRoleList="getRoleList"
...@@ -123,8 +114,7 @@ export default { ...@@ -123,8 +114,7 @@ export default {
}, },
], ],
tableSourceData: [], tableSourceData: [],
formTitle: undefined, //表单title formTitle: "", //表单title
sourceInfoForm: {},
roleDict: {}, roleDict: {},
}; };
}, },
...@@ -171,15 +161,11 @@ export default { ...@@ -171,15 +161,11 @@ export default {
}, },
showRoleEditModal(isEdit, row) { showRoleEditModal(isEdit, row) {
if (isEdit) { if (isEdit) {
this.sourceInfoForm = deepClone(row);
this.formTitle = "编辑"; this.formTitle = "编辑";
this.$refs.AddEditRole.onEdit(row);
} else { } else {
let obj = {
name: undefined, //姓名
remark: undefined, //描述
};
this.sourceInfoForm = obj;
this.formTitle = "添加"; this.formTitle = "添加";
this.$refs.AddEditRole.onAdd();
} }
this.$refs.AddEditRole.roleEditModalVisible = true; this.$refs.AddEditRole.roleEditModalVisible = true;
}, },
...@@ -192,16 +178,16 @@ export default { ...@@ -192,16 +178,16 @@ export default {
content: "此操作将删除该角色及权限信息,是否继续?", content: "此操作将删除该角色及权限信息,是否继续?",
okText: "", okText: "",
cancelText: "", cancelText: "",
centered: true,
onOk() { onOk() {
roleDelete({ roleDelete({
id: row.id, id: row.id,
}).then((res) => { }).then((res) => {
// console.log(res);
if (res.code == 1) { if (res.code == 1) {
_this.$message.success("删除成功");
//重新获取table数据 //重新获取table数据
_this.$nextTick(() => { _this.$nextTick(() => {
_this.getRoleList(); _this.getRoleList();
// _this.$message.success(res.data.message);
}); });
} else { } else {
_this.$message.error(res.data.message); _this.$message.error(res.data.message);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
:label-col="{ span: 6 }" :label-col="{ span: 6 }"
:wrapper-col="{ span: 18 }" :wrapper-col="{ span: 18 }"
> >
<a-form-model-item label="用户名" prop="loginName"> <a-form-model-item label="用户名">
<a-input <a-input
disabled disabled
v-model="form.loginName" v-model="form.loginName"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</a-form-model> </a-form-model>
<div slot="footer"> <div slot="footer">
<a-button style="margin-left: 10px" @click="handleClose">取消</a-button> <a-button style="margin-left: 10px" @click="handleReset">重置</a-button>
<a-button type="primary" class="addclass" @click="handleOk" <a-button type="primary" class="addclass" @click="handleOk"
>确定</a-button >确定</a-button
> >
...@@ -117,6 +117,9 @@ export default { ...@@ -117,6 +117,9 @@ export default {
} }
}); });
}, },
handleReset() {
this.$refs.formData.resetFields();
},
handleClose() { handleClose() {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.Visible = false; this.Visible = false;
...@@ -125,5 +128,4 @@ export default { ...@@ -125,5 +128,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
<template> <template>
<div> <div>
<a-modal <a-modal
:destroyOnClose="true"
title="编辑" title="编辑"
:centered="true" :centered="true"
:visible="Visible" :visible="Visible"
@cancel="Visible = false" @cancel="handelCancel"
:maskClosable="false" :maskClosable="false"
> >
<a-form-model <a-form-model
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
@change="handleSelect" @change="handleSelect"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="电话"> <a-form-model-item label="电话" prop="mobile">
<a-input placeholder="请输入电话号码" v-model="form.mobile" /> <a-input placeholder="请输入电话号码" v-model="form.mobile" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item ref="realName" label="用户姓名" prop="realName"> <a-form-model-item ref="realName" label="用户姓名" prop="realName">
...@@ -152,25 +151,24 @@ export default { ...@@ -152,25 +151,24 @@ export default {
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.form = { ...row }; setTimeout(() => {
try { this.form = { ...row };
this.form.areaNames = JSON.parse(this.form.areaNames); try {
} catch (err) { this.form.areaNames = JSON.parse(this.form.areaNames);
this.form.areaNames = this.form.areaNames; } catch (err) {
console.log(typeof this.form.areaNames); this.form.areaNames = this.form.areaNames;
} }
if (typeof this.form.areaNames == "string") { if (typeof this.form.areaNames == "string") {
this.selectAreaList = [this.form.areaNames]; this.selectAreaList = [this.form.areaNames];
} else {
if (this.form.areaNames.length) {
this.selectAreaList = this.form.areaNames.map((v) => v.label);
} else { } else {
this.selectAreaList = []; if (this.form.areaNames.length) {
this.selectAreaList = this.form.areaNames.map((v) => v.label);
} else {
this.selectAreaList = [];
}
} }
} this.form.loginPwd && this.$delete(this.form, "loginPwd");
}, 10);
// this.form.areaCodes = this.form.areaCodes.split(",");
this.form.loginPwd && this.$delete(this.form, "loginPwd");
}, },
// 提交 // 提交
onSubmit() { onSubmit() {
...@@ -187,6 +185,10 @@ export default { ...@@ -187,6 +185,10 @@ export default {
: (hash[next.areaCode] = true && item.push(next)); : (hash[next.areaCode] = true && item.push(next));
return item; return item;
}, []); }, []);
if (!this.form.areaNames.length) {
this.$message.warning("请选择站点区域");
return;
}
let res = await userSave({ let res = await userSave({
...this.form, ...this.form,
areaNames: JSON.stringify(this.form.areaNames), areaNames: JSON.stringify(this.form.areaNames),
...@@ -197,13 +199,19 @@ export default { ...@@ -197,13 +199,19 @@ export default {
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.$emit("EditSuccess"); this.$emit("EditSuccess");
this.Visible = false; this.handelCancel();
} }
} }
}); });
}, },
resetForm() { resetForm() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
this.selectAreaList = [];
},
handelCancel() {
this.$refs.ruleForm.resetFields();
this.selectAreaList = [];
this.Visible = false;
}, },
// 选中树节点 // 选中树节点
handleSelect(value, node, extra) { handleSelect(value, node, extra) {
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
:title="formTitle" :title="formTitle"
:getContainer="() => $refs.roleEditModal_box" :getContainer="() => $refs.roleEditModal_box"
:centered="true" :centered="true"
:destroyOnClose="true"
:visible="roleEditModalVisible" :visible="roleEditModalVisible"
:confirmLoading="roleEditModalLoading" :confirmLoading="roleEditModalLoading"
@cancel="roleEditModalVisible = false" @cancel="handleCancel"
width="30%" width="30%"
:maskClosable="false" :maskClosable="false"
> >
...@@ -41,22 +40,32 @@ ...@@ -41,22 +40,32 @@
</a-form-model> </a-form-model>
<template slot="footer"> <template slot="footer">
<a-button @click="resetForm">重置</a-button> <a-button @click="resetForm">重置</a-button>
<a-button type="primary" class="addclass" @click="roleEditModal_Ok">确定</a-button> <a-button type="primary" class="addclass" @click="roleEditModal_Ok"
>确定</a-button
>
</template> </template>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import { deepClone } from "@/utils/js/common.js";
import { roleSave } from "@/api/authorityMis.js"; import { roleSave } from "@/api/authorityMis.js";
export default { export default {
name: "PortalAdminVueNewRole", name: "PortalAdminVueNewRole",
props: {
formTitle: {
type: String,
default: "编辑",
},
},
data() { data() {
return { return {
roleEditModalVisible: false, //模态 roleEditModalVisible: false, //模态
roleEditModalLoading: false, //确定回调 loading roleEditModalLoading: false, //确定回调 loading
compileInfoForm: {}, //页面表单信息 compileInfoForm: {
name: "", //姓名
remark: "", //描述
}, //页面表单信息
roleRules: { roleRules: {
name: [ name: [
{ {
...@@ -65,10 +74,6 @@ export default { ...@@ -65,10 +74,6 @@ export default {
message: "请输入角色名称", message: "请输入角色名称",
trigger: "blur", trigger: "blur",
}, },
// {
// pattern: /^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/,
// message: "不能有特殊字符和数字、长度在1-20",
// },
], ],
remark: [ remark: [
{ {
...@@ -81,57 +86,24 @@ export default { ...@@ -81,57 +86,24 @@ export default {
}, },
}; };
}, },
props: { methods: {
roleDict: { onAdd() {
type: Object, Object.assign(this.compileInfoForm, this.$options.data().compileInfoForm);
default: () => { this.compileInfoForm.id && this.$delete(this.compileInfoForm, "id");
return {};
},
},
formTitle: {
type: String,
default: () => {
return "编辑";
},
},
sourceInfoForm: {
type: Object,
default: () => {
return {};
},
}, },
}, onEdit(row) {
watch: { setTimeout(() => {
sourceInfoForm: { this.compileInfoForm = { ...row };
handler(newValue, oldValue) { }, 10);
// console.log(newValue);
// console.log(oldValue);
this.compileInfoForm = deepClone(newValue);
for (let key in this.roleRules) {
this.roleRules[key][0].required = this.formTitle == "添加";
}
},
deep: true,
}, },
},
mounted() {},
methods: {
roleEditModal_Ok() { roleEditModal_Ok() {
this.$refs.compileInfoForm.validate((valid) => { this.$refs.compileInfoForm.validate((valid) => {
if (valid) { if (valid) {
// this.roleEditModalLoading = true; roleSave(this.compileInfoForm).then((res) => {
let submitObj = {
name: this.compileInfoForm.name,
remark: this.compileInfoForm.remark,
};
if (this.formTitle == "编辑") {
submitObj["id"] = this.compileInfoForm["id"];
}
roleSave(submitObj).then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.$emit("getRoleList"); this.$emit("getRoleList");
// this.$message.success(res.msg); this.$message.success(res.msg);
this.roleEditModalVisible = false; this.handleCancel();
} }
}); });
} else { } else {
...@@ -142,10 +114,12 @@ export default { ...@@ -142,10 +114,12 @@ export default {
}, },
resetForm() { resetForm() {
// 重置还原表单信息内容 // 重置还原表单信息内容
this.$set(this, "compileInfoForm", this.sourceInfoForm); this.$refs.compileInfoForm.resetFields();
this.$nextTick(() => { },
this.$refs.compileInfoForm.resetFields(); handleCancel() {
}); // 重置还原表单信息内容
this.$refs.compileInfoForm.resetFields();
this.roleEditModalVisible = false;
}, },
}, },
}; };
...@@ -158,30 +132,5 @@ export default { ...@@ -158,30 +132,5 @@ export default {
max-height: 550px !important; max-height: 550px !important;
overflow-y: auto !important; overflow-y: auto !important;
} }
//.ant-modal-footer {
// text-align: left !important;
// }
//.ant-form-item-label > label::after {
// display: none !important;
// }
//.ant-form-item {
// .ant-form-item-label {
// &::after {
// content: ":";
// position: relative;
// top: -0.5px;
// margin: 0 8px 0 2px;
// }
// }
// }
//.ant-form-item:last-child {
// .ant-form-item-label {
// &::after {
// display: none !important;
// }
// }
// }
} }
</style> </style>
\ No newline at end of file
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
> >
<a-form-model-item label="站点授权" prop="areaCodes"> <a-form-model-item label="站点授权" prop="areaCodes">
<a-tree-select <a-tree-select
v-model="form.areaCodes" v-model="changeSelect"
style="width: 100%" style="width: 100%"
:tree-data="treeData" :tree-data="treeData"
allowClear allowClear
:load-data="onLoadData" :load-data="onLoadData"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
tree-checkable tree-checkable
labelInValue
:show-checked-strategy="SHOW_PARENT" :show-checked-strategy="SHOW_PARENT"
placeholder="请选择站点区域" placeholder="请选择站点区域"
:replaceFields="replaceFields" :replaceFields="replaceFields"
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
" "
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="电话"> <a-form-model-item label="电话" prop="mobile">
<a-input placeholder="请输入电话号码" v-model="form.mobile" /> <a-input placeholder="请输入电话号码" v-model="form.mobile" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item ref="realName" label="用户姓名" prop="realName"> <a-form-model-item ref="realName" label="用户姓名" prop="realName">
...@@ -101,6 +102,7 @@ export default { ...@@ -101,6 +102,7 @@ export default {
labelCol: { span: 4 }, labelCol: { span: 4 },
wrapperCol: { span: 20 }, wrapperCol: { span: 20 },
changeSelect: [], changeSelect: [],
form: { form: {
loginName: undefined, loginName: undefined,
loginPwd: undefined, loginPwd: undefined,
...@@ -111,6 +113,9 @@ export default { ...@@ -111,6 +113,9 @@ export default {
areaNames: undefined, areaNames: undefined,
}, },
rules: { rules: {
areaCodes: [
{ required: true, message: "请选择站点区域", trigger: "change" },
],
loginName: [ loginName: [
{ required: true, validator: changeAccount, trigger: "blur" }, { required: true, validator: changeAccount, trigger: "blur" },
], ],
...@@ -188,10 +193,15 @@ export default { ...@@ -188,10 +193,15 @@ export default {
onSubmit() { onSubmit() {
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
let areas = this.changeSelect.map((v) => {
return {
areaCode: v.value,
label: v.label,
};
});
let res = await userSave({ let res = await userSave({
...this.form, ...this.form,
areaCodes: this.form.areaCodes.join(","), areaNames: JSON.stringify(areas),
areaNames: JSON.stringify(this.changeSelect),
loginName: encrypt(this.form.loginName), loginName: encrypt(this.form.loginName),
loginPwd: encrypt(this.form.loginPwd), loginPwd: encrypt(this.form.loginPwd),
}); });
...@@ -209,21 +219,8 @@ export default { ...@@ -209,21 +219,8 @@ export default {
this.changeSelect = []; this.changeSelect = [];
}, },
// 选择区域 // 选择区域
handleSelect(value, node, extra) { handleSelect() {
let { allCheckedNodes } = extra; this.form.areaCodes = this.changeSelect.map((v) => v.value).join(",");
this.changeSelect = allCheckedNodes.map((v) => {
if (v.node) {
return {
areaCode: v.node.data.props.areaCode,
label: v.node.data.props.label,
};
} else {
return {
areaCode: v.data.props.areaCode,
label: v.data.props.label,
};
}
});
}, },
}, },
}; };
......
...@@ -250,6 +250,7 @@ export default { ...@@ -250,6 +250,7 @@ export default {
content: "此操作将删除该角色及权限信息,是否继续?", content: "此操作将删除该角色及权限信息,是否继续?",
okText: "", okText: "",
cancelText: "", cancelText: "",
centered: true,
onOk() { onOk() {
userDelete({ userDelete({
id: val, id: val,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:width="modalInfo.width" :width="modalInfo.width"
:visible="modalInfo.visible" :visible="modalInfo.visible"
:title="modalInfo.title" :title="modalInfo.title"
@cancel="modalInfo.visible = false" @cancel="resetForm"
centered centered
destroyOnClose destroyOnClose
> >
...@@ -61,11 +61,10 @@ ...@@ -61,11 +61,10 @@
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<template slot="footer"> <template slot="footer">
<a-button type="primary" class="addclass" @click="reset">重置</a-button> <a-button @click="reset">重置</a-button>
<a-button type="primary" class="addclass" @click="Modal_Ok" <a-button type="primary" class="addclass" @click="Modal_Ok"
>确定</a-button >确定</a-button
> >
<a-button @click="resetForm">取消</a-button>
</template> </template>
</a-modal> </a-modal>
</template> </template>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:width="modalInfo.width" :width="modalInfo.width"
:visible="modalInfo.visible" :visible="modalInfo.visible"
:title="modalInfo.title" :title="modalInfo.title"
@cancel="modalInfo.visible = false" @cancel="resetForm"
centered centered
destroyOnClose destroyOnClose
> >
...@@ -44,11 +44,10 @@ ...@@ -44,11 +44,10 @@
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<template slot="footer"> <template slot="footer">
<a-button type="primary" class="addclass" @click="reset">重置</a-button> <a-button @click="reset">重置</a-button>
<a-button type="primary" class="addclass" @click="Modal_Ok" <a-button type="primary" class="addclass" @click="Modal_Ok"
>确定</a-button >确定</a-button
> >
<a-button @click="resetForm">取消</a-button>
</template> </template>
</a-modal> </a-modal>
</template> </template>
......
...@@ -94,6 +94,7 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -94,6 +94,7 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
String menuUrl = userObj.getString("menuUrl"); String menuUrl = userObj.getString("menuUrl");
Boolean isManager = userObj.getBoolean("manager"); Boolean isManager = userObj.getBoolean("manager");
Boolean isSystemUser = userObj.getBoolean("systemUser"); Boolean isSystemUser = userObj.getBoolean("systemUser");
String areaCodes = userObj.getString("areaCodes");
return new IUser() { return new IUser() {
@Override @Override
...@@ -126,6 +127,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -126,6 +127,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
return siteIds; return siteIds;
} }
@Override
public String getAreaCodes() {
return areaCodes;
}
@Override @Override
public Long getCustomerJoinId() { public Long getCustomerJoinId() {
return null; return null;
......
...@@ -120,7 +120,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -120,7 +120,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
return ret.toJSONString(); return ret.toJSONString();
} catch (Exception e) { } catch (Exception e) {
log.error("login error ", e); log.error("login error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); if(e instanceof AppException){
ret.put(KEY_RESULT_CODE, ((AppException) e).getCode());
}else {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
}
ret.put(KEY_RESULT_MSG, super.convertException(e)); ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString(); return ret.toJSONString();
} }
......
...@@ -210,7 +210,7 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -210,7 +210,7 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
if(sysUser.getLastUpdatePwdTime()!=null) { if(sysUser.getLastUpdatePwdTime()!=null) {
long day = DateUtils.getBetween(sysUser.getLastUpdatePwdTime(), new Date(), 2); long day = DateUtils.getBetween(sysUser.getLastUpdatePwdTime(), new Date(), 2);
if (day >= 90) { if (day >= 90) {
throw new AppException("密码已超过三个月没有更改,请修改以后再登录"); throw new AppException(99998,"密码已超过三个月没有更改,请修改以后再登录");
} }
} }
} }
...@@ -445,6 +445,10 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -445,6 +445,10 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
throw new AppException("帐号错误!"); throw new AppException("帐号错误!");
} }
try { try {
if(StringUtils.isEmpty(sysUser.getSaltKey())) {
String saltKey = SecurityCode.getSecurityCode(6,SecurityCode.SecurityCodeLevel.Medium,false);
sysUser.setSaltKey(saltKey);
}
sysUser.setLoginPwd(SecurityUtil.md5DoubleEncoding(newPwd + sysUser.getSaltKey())); sysUser.setLoginPwd(SecurityUtil.md5DoubleEncoding(newPwd + sysUser.getSaltKey()));
} catch (Exception e) { } catch (Exception e) {
throw new AppException("密码转换异常!", e); throw new AppException("密码转换异常!", e);
...@@ -522,4 +526,5 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -522,4 +526,5 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
return successMsg.toString(); return successMsg.toString();
} }
} }
\ No newline at end of file
...@@ -174,6 +174,25 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -174,6 +174,25 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
return ret.toJSONString(); return ret.toJSONString();
} }
@RequestMapping(value = "forgot/password", method = RequestMethod.POST)
@UnAuth
public String forgotPassword(@RequestBody UserEntity entity) {
JSONObject ret = new JSONObject();
try {
String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
entity.setOldPwd(oldPwd);
entity.setNewPwd(newPwd);
service.updateUserPwd(entity.getLoginName(), entity.getOldPwd(), entity.getNewPwd());
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "密码修改成功!");
} catch (Exception e) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
}
return ret.toJSONString();
}
/** /**
* 站点授权 * 站点授权
* *
......
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