Commit 15017fd2 authored by “yiyousong”'s avatar “yiyousong”

perf: 格式化

parent 3eeb7834
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
> --> > -->
</div> </div>
<!-- <div class="bullshit__headline">{{ message }}</div> --> <!-- <div class="bullshit__headline">{{ message }}</div> -->
<div class="bullshit__info"> <div class="bullshit__info">请检查您输入的网址是否正确,或点击下面的按钮返回。</div>
请检查您输入的网址是否正确,或点击下面的按钮返回。
</div>
<a class="bullshit__return-home" @click="handleGoHome">返回</a> <a class="bullshit__return-home" @click="handleGoHome">返回</a>
</div> </div>
</div> </div>
...@@ -30,15 +28,15 @@ ...@@ -30,15 +28,15 @@
<script> <script>
export default { export default {
name: "Page404", name: 'Page404',
data() { data() {
return {}; return {};
}, },
methods: { methods: {
handleGoHome() { handleGoHome() {
this.$router.back(); this.$router.back();
}, }
}, }
}; };
</script> </script>
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
class="search-box top-radius flex h-full items-center gap-5" class="search-box top-radius flex h-full items-center gap-5"
v-hasPermi="['engine:query']" v-hasPermi="['engine:query']"
> >
<div class="text-[14px] text-[#395EBF]"> <div class="text-[14px] text-[#395EBF]">统计时段:{{ time[0] }}~{{ time[1] }}</div>
统计时段:{{ time[0] }}~{{ time[1] }}
</div>
<y-date-picker <y-date-picker
v-model="time" v-model="time"
align="right" align="right"
...@@ -28,9 +26,7 @@ ...@@ -28,9 +26,7 @@
end-placeholder="结束日期" end-placeholder="结束日期"
> >
</y-date-picker> </y-date-picker>
<el-button size="small" type="primary" @click="handleDate" <el-button size="small" type="primary" @click="handleDate">搜索</el-button>
>搜索</el-button
>
</div> </div>
<div <div
class="engine-btn top-radius" class="engine-btn top-radius"
...@@ -49,25 +45,22 @@ ...@@ -49,25 +45,22 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
return { return {
time: [ time: [this.$moment().format('YYYY-MM-DD'), this.$moment().format('YYYY-MM-DD')]
this.$moment().format("YYYY-MM-DD"),
this.$moment().format("YYYY-MM-DD"),
],
}; };
}, },
watch: { watch: {
"$route.path"() { '$route.path'() {
this.$nextTick(() => { this.$nextTick(() => {
this.handleDate(); this.handleDate();
}); });
}, }
}, },
computed: { computed: {
...mapGetters("user", ["secondaryRoutes"]), ...mapGetters('user', ['secondaryRoutes'])
}, },
created() { created() {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -77,8 +70,8 @@ export default { ...@@ -77,8 +70,8 @@ export default {
methods: { methods: {
handleDate() { handleDate() {
this.$refs.Page.getDate(this.time); this.$refs.Page.getDate(this.time);
}, }
}, }
}; };
</script> </script>
...@@ -133,11 +126,7 @@ export default { ...@@ -133,11 +126,7 @@ export default {
.engine-btn { .engine-btn {
width: 220px; width: 220px;
color: #fff; color: #fff;
background: linear-gradient( background: linear-gradient(270deg, rgba(139, 87, 249, 1) 0%, rgba(5, 149, 253, 1) 100%);
270deg,
rgba(139, 87, 249, 1) 0%,
rgba(5, 149, 253, 1) 100%
);
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
display: flex; display: flex;
......
This diff is collapsed.
...@@ -106,23 +106,23 @@ ...@@ -106,23 +106,23 @@
</template> </template>
<script> <script>
import DoubleTable from "./components/DoubleTable.vue"; import DoubleTable from './components/DoubleTable.vue';
import { getQueueSystemList } from "@/api/engine"; import { getQueueSystemList } from '@/api/engine';
import { export2Excel } from "@/utils/exportExcel"; import { export2Excel } from '@/utils/exportExcel';
import { dataSection } from "@/utils"; import { dataSection } from '@/utils';
import storage from "@/utils/storage"; import storage from '@/utils/storage';
export default { export default {
components: { components: {
DoubleTable, DoubleTable
}, },
data() { data() {
return { return {
dict: {}, dict: {},
dateForm: { dateForm: {
timeStart: this.$moment().format("YYYY-MM-DD"), timeStart: this.$moment().format('YYYY-MM-DD'),
timeEnd: this.$moment().format("YYYY-MM-DD"), timeEnd: this.$moment().format('YYYY-MM-DD')
}, },
siteId: storage.get(2, "siteId"), siteId: storage.get(2, 'siteId'),
hallLoading: false, hallLoading: false,
businessLoading: false, businessLoading: false,
deptLoading: false, deptLoading: false,
...@@ -131,112 +131,112 @@ export default { ...@@ -131,112 +131,112 @@ export default {
total: 0, total: 0,
page: 1, page: 1,
size: 10, size: 10,
hallNameNotList: [""], hallNameNotList: ['']
}, },
businessSearch: { businessSearch: {
total: 0, total: 0,
page: 1, page: 1,
size: 10, size: 10,
businessNotList: [""], businessNotList: [''],
businessList: [], businessList: [],
groupList: ["business"], groupList: ['business']
}, },
deptSearch: { deptSearch: {
total: 0, total: 0,
page: 1, page: 1,
size: 10, size: 10,
sectionNameNotList: [""], sectionNameNotList: [''],
sectionNameList: [], sectionNameList: []
}, },
windowSearch: { windowSearch: {
total: 0, total: 0,
page: 1, page: 1,
size: 10, size: 10,
windowFromnumNotList: [""], windowFromnumNotList: [''],
windowFromnumList: [], windowFromnumList: []
}, },
hallColumn: [ hallColumn: [
{ {
label: "大厅名称", label: '大厅名称',
prop: "hallName", prop: 'hallName',
align: "center", align: 'center',
showOverflowTooltip: true, showOverflowTooltip: true
}, },
{ {
label: "排队数量", label: '排队数量',
prop: "phCount", prop: 'phCount',
align: "center", align: 'center',
formatter: (row, column, cellValue) => { formatter: (row, column, cellValue) => {
if (cellValue) { if (cellValue) {
return <span class="table-num">{cellValue}</span>; return <span class="table-num">{cellValue}</span>;
} }
}, }
}, }
], ],
businessColumn: [ businessColumn: [
{ {
label: "业务名称", label: '业务名称',
prop: "business", prop: 'business',
align: "center", align: 'center',
showOverflowTooltip: true, showOverflowTooltip: true,
formatter: (row, column, cellValue) => { formatter: (row, column, cellValue) => {
if (cellValue) { if (cellValue) {
return <span>{cellValue}</span>; return <span>{cellValue}</span>;
} }
}, }
}, },
{ {
label: "排队数量", label: '排队数量',
prop: "phCount", prop: 'phCount',
align: "center", align: 'center',
formatter: (row, column, cellValue) => { formatter: (row, column, cellValue) => {
if (cellValue) { if (cellValue) {
return <span class="table-num">{cellValue}</span>; return <span class="table-num">{cellValue}</span>;
} }
}, }
}, }
], ],
deptColumn: [ deptColumn: [
{ {
label: "部门名称", label: '部门名称',
prop: "sectionName", prop: 'sectionName',
showOverflowTooltip: true, showOverflowTooltip: true,
align: "center", align: 'center'
}, },
{ {
label: "排队数量", label: '排队数量',
prop: "phCount", prop: 'phCount',
align: "center", align: 'center',
formatter: (row, column, cellValue) => { formatter: (row, column, cellValue) => {
if (cellValue) { if (cellValue) {
return <span class="table-num">{cellValue}</span>; return <span class="table-num">{cellValue}</span>;
} }
}, }
}, }
], ],
windowColumn: [ windowColumn: [
{ {
label: "窗口编号", label: '窗口编号',
prop: "windowFromnum", prop: 'windowFromnum',
showOverflowTooltip: true, showOverflowTooltip: true,
align: "center", align: 'center'
}, },
{ {
label: "排队数量", label: '排队数量',
prop: "phCount", prop: 'phCount',
align: "center", align: 'center',
formatter: (row, column, cellValue) => { formatter: (row, column, cellValue) => {
if (cellValue) { if (cellValue) {
return <span class="table-num">{cellValue}</span>; return <span class="table-num">{cellValue}</span>;
} }
}, }
}, }
], ],
hallTableData: [], hallTableData: [],
businessTableData: [], businessTableData: [],
deptTableData: [], deptTableData: [],
windowTableData: [], windowTableData: []
}; };
}, },
created() { created() {
...@@ -264,7 +264,7 @@ export default { ...@@ -264,7 +264,7 @@ export default {
siteId: this.siteId, siteId: this.siteId,
...this.hallSearch, ...this.hallSearch,
...this.dateForm, ...this.dateForm,
...form, ...form
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
...@@ -272,13 +272,13 @@ export default { ...@@ -272,13 +272,13 @@ export default {
return { return {
data: data, data: data,
total: total, total: total,
dict, dict
}; };
} else { } else {
return { return {
data: [], data: [],
total: 0, total: 0,
dict: {}, dict: {}
}; };
} }
}, },
...@@ -297,7 +297,7 @@ export default { ...@@ -297,7 +297,7 @@ export default {
siteId: this.siteId, siteId: this.siteId,
...this.businessSearch, ...this.businessSearch,
...this.dateForm, ...this.dateForm,
...form, ...form
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
...@@ -305,13 +305,13 @@ export default { ...@@ -305,13 +305,13 @@ export default {
return { return {
data, data,
total, total,
dict, dict
}; };
} else { } else {
return { return {
data: [], data: [],
total: 0, total: 0,
dict: {}, dict: {}
}; };
} }
}, },
...@@ -329,20 +329,20 @@ export default { ...@@ -329,20 +329,20 @@ export default {
siteId: this.siteId, siteId: this.siteId,
...this.deptSearch, ...this.deptSearch,
...this.dateForm, ...this.dateForm,
...form, ...form
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
return { return {
data, data,
total, total,
dict, dict
}; };
} else { } else {
return { return {
data: [], data: [],
total: 0, total: 0,
dict: {}, dict: {}
}; };
} }
}, },
...@@ -361,20 +361,20 @@ export default { ...@@ -361,20 +361,20 @@ export default {
siteId: this.siteId, siteId: this.siteId,
...this.windowSearch, ...this.windowSearch,
...this.dateForm, ...this.dateForm,
...form, ...form
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
return { return {
data, data,
total, total,
dict, dict
}; };
} else { } else {
return { return {
data: [], data: [],
total: 0, total: 0,
dict: {}, dict: {}
}; };
} }
}, },
...@@ -393,14 +393,14 @@ export default { ...@@ -393,14 +393,14 @@ export default {
let filterVal = this.hallColumn.map((v) => v.prop); let filterVal = this.hallColumn.map((v) => v.prop);
dataSection(this.hallQueueFn, {}, (data) => { dataSection(this.hallQueueFn, {}, (data) => {
if (!data.length) { if (!data.length) {
this.$message.warning("暂无数据"); this.$message.warning('暂无数据');
return; return;
} }
export2Excel( export2Excel(
tHeader, tHeader,
filterVal, filterVal,
data, data,
"大厅取号量统计报表" + this.$moment().format("YYYYMMDDHHmmss") '大厅取号量统计报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
}); });
}, },
...@@ -415,14 +415,14 @@ export default { ...@@ -415,14 +415,14 @@ export default {
} }
dataSection(this.businessQueue, searchForm, (data) => { dataSection(this.businessQueue, searchForm, (data) => {
if (!data.length) { if (!data.length) {
this.$message.warning("暂无数据"); this.$message.warning('暂无数据');
return; return;
} }
export2Excel( export2Excel(
tHeader, tHeader,
filterVal, filterVal,
data, data,
"业务取号量统计报表" + this.$moment().format("YYYYMMDDHHmmss") '业务取号量统计报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
}); });
}, },
...@@ -437,14 +437,14 @@ export default { ...@@ -437,14 +437,14 @@ export default {
} }
dataSection(this.deptQueue, searchForm, (data) => { dataSection(this.deptQueue, searchForm, (data) => {
if (!data.length) { if (!data.length) {
this.$message.warning("暂无数据"); this.$message.warning('暂无数据');
return; return;
} }
export2Excel( export2Excel(
tHeader, tHeader,
filterVal, filterVal,
data, data,
"部门取号量统计报表" + this.$moment().format("YYYYMMDDHHmmss") '部门取号量统计报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
}); });
}, },
...@@ -459,14 +459,14 @@ export default { ...@@ -459,14 +459,14 @@ export default {
} }
dataSection(this.windowQueue, searchForm, (data) => { dataSection(this.windowQueue, searchForm, (data) => {
if (!data.length) { if (!data.length) {
this.$message.warning("暂无数据"); this.$message.warning('暂无数据');
return; return;
} }
export2Excel( export2Excel(
tHeader, tHeader,
filterVal, filterVal,
data, data,
"窗口取号量统计报表" + this.$moment().format("YYYYMMDDHHmmss") '窗口取号量统计报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
}); });
}, },
...@@ -480,18 +480,18 @@ export default { ...@@ -480,18 +480,18 @@ export default {
searchObj[listKey] = value ? [value] : []; searchObj[listKey] = value ? [value] : [];
}; };
if (type === "business") { if (type === 'business') {
setupSearch(this.businessSearch, "businessList", businessName); setupSearch(this.businessSearch, 'businessList', businessName);
this.getBusinessQueue(); this.getBusinessQueue();
} else if (type === "dept") { } else if (type === 'dept') {
setupSearch(this.deptSearch, "sectionNameList", deptName); setupSearch(this.deptSearch, 'sectionNameList', deptName);
this.getDeptQueue(); this.getDeptQueue();
} else if (type === "window") { } else if (type === 'window') {
setupSearch(this.windowSearch, "windowFromnumList", windowNum); setupSearch(this.windowSearch, 'windowFromnumList', windowNum);
this.getWindowQueue(); this.getWindowQueue();
} }
}, }
}, }
}; };
</script> </script>
......
...@@ -45,86 +45,86 @@ ...@@ -45,86 +45,86 @@
</template> </template>
<script> <script>
import Search from "./components/Search.vue"; import Search from './components/Search.vue';
import TableHeader from "@/components/TableHeader.vue"; import TableHeader from '@/components/TableHeader.vue';
import { getEvaStatList } from "@/api/engine"; import { getEvaStatList } from '@/api/engine';
import { formatSeconds, dataSection } from "@/utils"; import { formatSeconds, dataSection } from '@/utils';
import { export2Excel } from "@/utils/exportExcel"; import { export2Excel } from '@/utils/exportExcel';
import storage from "@/utils/storage"; import storage from '@/utils/storage';
export default { export default {
components: { components: {
Search, Search,
TableHeader, TableHeader
}, },
data() { data() {
return { return {
loading: false, loading: false,
exportLoading: false, exportLoading: false,
siteId: storage.get(2, "siteId"), siteId: storage.get(2, 'siteId'),
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
tableData: [], tableData: [],
column: [ column: [
{ {
label: "全选", label: '全选',
type: "selection", type: 'selection',
width: "55", width: '55',
align: "center", align: 'center',
reserveSelection: true, reserveSelection: true
}, },
{ {
label: "序号", label: '序号',
type: "index", type: 'index',
width: "55", width: '55',
align: "center", align: 'center',
index: (index) => { index: (index) => {
return (this.page - 1) * this.size + index + 1; return (this.page - 1) * this.size + index + 1;
}, }
}, },
{ {
label: "站点名称", label: '站点名称',
prop: "siteName", prop: 'siteName',
align: "center", align: 'center'
}, },
{ {
label: "部门名称", label: '部门名称',
prop: "sectionName", prop: 'sectionName',
align: "center", align: 'center'
}, },
{ {
label: "评价选型", label: '评价选型',
prop: "pjOption", prop: 'pjOption',
align: "center", align: 'center'
}, },
{ {
label: "窗口编号", label: '窗口编号',
prop: "windowFromnum", prop: 'windowFromnum',
align: "center", align: 'center'
}, },
{ {
label: "年份", label: '年份',
prop: "year", prop: 'year',
align: "center", align: 'center'
}, },
{ {
label: "月份", label: '月份',
prop: "month", prop: 'month',
align: "center", align: 'center'
}, },
{ {
label: "日期", label: '日期',
prop: "day", prop: 'day',
align: "center", align: 'center'
}, },
{ {
label: "评价数量", label: '评价数量',
prop: "pjCount", prop: 'pjCount',
align: "center", align: 'center'
}, }
], ],
selectionRows: [], selectionRows: [],
searchForm: { searchForm: {
...@@ -135,11 +135,11 @@ export default { ...@@ -135,11 +135,11 @@ export default {
pjOptionList: [], pjOptionList: [],
sectionNameList: [], sectionNameList: [],
windowFromnumList: [], windowFromnumList: [],
year: "", year: '',
month: "", month: '',
day: "", day: ''
}, },
dict: {}, dict: {}
}; };
}, },
created() { created() {
...@@ -153,20 +153,20 @@ export default { ...@@ -153,20 +153,20 @@ export default {
size: this.size, size: this.size,
siteId: this.siteId, siteId: this.siteId,
...this.searchForm, ...this.searchForm,
...form, ...form
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
return { return {
data, data,
total, total,
dict, dict
}; };
} else { } else {
return { return {
data: [], data: [],
total: 0, total: 0,
dict: {}, dict: {}
}; };
} }
}, },
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
this.loading = true; this.loading = true;
let { data, total, dict } = await this.evaStatList(); let { data, total, dict } = await this.evaStatList();
data.forEach((v) => { data.forEach((v) => {
v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : ""; v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : '';
}); });
this.total = total; this.total = total;
this.tableData = data; this.tableData = data;
...@@ -189,23 +189,22 @@ export default { ...@@ -189,23 +189,22 @@ export default {
handleSearch(form) { handleSearch(form) {
let { type, pjOption, deptName, windowNum, year, month, day } = form; let { type, pjOption, deptName, windowNum, year, month, day } = form;
this.searchForm.year = ""; this.searchForm.year = '';
this.searchForm.month = ""; this.searchForm.month = '';
this.searchForm.day = ""; this.searchForm.day = '';
if (type === "year") { if (type === 'year') {
this.searchForm.groupList = ["year"]; this.searchForm.groupList = ['year'];
this.searchForm.year = year; this.searchForm.year = year;
} else if (type === "month") { } else if (type === 'month') {
this.searchForm.groupList = ["year", "month"]; this.searchForm.groupList = ['year', 'month'];
if (month) { if (month) {
[this.searchForm.year, this.searchForm.month] = month.split("-"); [this.searchForm.year, this.searchForm.month] = month.split('-');
} }
} else { } else {
this.searchForm.groupList = ["year", "month", "day"]; this.searchForm.groupList = ['year', 'month', 'day'];
if (day) { if (day) {
[this.searchForm.year, this.searchForm.month, this.searchForm.day] = [this.searchForm.year, this.searchForm.month, this.searchForm.day] = day.split('-');
day.split("-");
} }
} }
...@@ -229,28 +228,28 @@ export default { ...@@ -229,28 +228,28 @@ export default {
tHeader, tHeader,
filterVal, filterVal,
data, data,
"排队数据汇总报表" + this.$moment().format("YYYYMMDDHHmmss") '排队数据汇总报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
} else { } else {
dataSection(this.queueStatList, {}, (data) => { dataSection(this.queueStatList, {}, (data) => {
if (!data.length) { if (!data.length) {
this.$message.warning("暂无数据"); this.$message.warning('暂无数据');
return; return;
} }
data.forEach((v) => { data.forEach((v) => {
v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : ""; v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : '';
}); });
export2Excel( export2Excel(
tHeader, tHeader,
filterVal, filterVal,
data, data,
"排队数据汇总报表" + this.$moment().format("YYYYMMDDHHmmss") '排队数据汇总报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
}); });
} }
this.exportLoading = false; this.exportLoading = false;
}, }
}, }
}; };
</script> </script>
......
...@@ -45,22 +45,22 @@ ...@@ -45,22 +45,22 @@
</template> </template>
<script> <script>
import Search from "./components/Search.vue"; import Search from './components/Search.vue';
import TableHeader from "@/components/TableHeader.vue"; import TableHeader from '@/components/TableHeader.vue';
import { getQueueStatList } from "@/api/engine"; import { getQueueStatList } from '@/api/engine';
import { formatSeconds, dataSection } from "@/utils"; import { formatSeconds, dataSection } from '@/utils';
import { export2Excel } from "@/utils/exportExcel"; import { export2Excel } from '@/utils/exportExcel';
import storage from "@/utils/storage"; import storage from '@/utils/storage';
export default { export default {
components: { components: {
Search, Search,
TableHeader, TableHeader
}, },
data() { data() {
return { return {
loading: false, loading: false,
exportLoading: false, exportLoading: false,
siteId: storage.get(2, "siteId"), siteId: storage.get(2, 'siteId'),
dict: {}, dict: {},
page: 1, page: 1,
size: 10, size: 10,
...@@ -68,68 +68,68 @@ export default { ...@@ -68,68 +68,68 @@ export default {
tableData: [], tableData: [],
column: [ column: [
{ {
label: "全选", label: '全选',
type: "selection", type: 'selection',
width: "55", width: '55',
align: "center", align: 'center',
reserveSelection: true, reserveSelection: true
}, },
{ {
label: "序号", label: '序号',
type: "index", type: 'index',
width: "55", width: '55',
align: "center", align: 'center',
index: (index) => { index: (index) => {
return (this.page - 1) * this.size + index + 1; return (this.page - 1) * this.size + index + 1;
}, }
}, },
{ {
label: "站点名称", label: '站点名称',
prop: "siteName", prop: 'siteName',
align: "center", align: 'center'
}, },
{ {
label: "业务名称", label: '业务名称',
prop: "business", prop: 'business',
align: "center", align: 'center'
}, },
{ {
label: "部门名称", label: '部门名称',
prop: "sectionName", prop: 'sectionName',
align: "center", align: 'center'
}, },
{ {
label: "窗口编号", label: '窗口编号',
prop: "windowFromnum", prop: 'windowFromnum',
align: "center", align: 'center'
}, },
{ {
label: "年份", label: '年份',
prop: "year", prop: 'year',
align: "center", align: 'center'
}, },
{ {
label: "月份", label: '月份',
prop: "month", prop: 'month',
align: "center", align: 'center'
}, },
{ {
label: "日期", label: '日期',
prop: "day", prop: 'day',
align: "center", align: 'center'
}, },
{ {
label: "办理量", label: '办理量',
prop: "phCount", prop: 'phCount',
align: "center", align: 'center'
}, },
{ {
label: "平均等待时长", label: '平均等待时长',
prop: "waitTime", prop: 'waitTime',
align: "center", align: 'center'
}, }
], ],
selectionRows: [], selectionRows: [],
searchForm: { searchForm: {
...@@ -140,10 +140,10 @@ export default { ...@@ -140,10 +140,10 @@ export default {
businessList: [], businessList: [],
sectionNameList: [], sectionNameList: [],
windowFromnumList: [], windowFromnumList: [],
year: "", year: '',
month: "", month: '',
day: "", day: ''
}, }
}; };
}, },
created() { created() {
...@@ -157,20 +157,20 @@ export default { ...@@ -157,20 +157,20 @@ export default {
size: this.size, size: this.size,
siteId: this.siteId, siteId: this.siteId,
...this.searchForm, ...this.searchForm,
...form, ...form
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total, dict } = res.data.data; let { data, total, dict } = res.data.data;
return { return {
data, data,
total, total,
dict, dict
}; };
} else { } else {
return { return {
data: [], data: [],
total: 0, total: 0,
dict: {}, dict: {}
}; };
} }
}, },
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
this.loading = true; this.loading = true;
let { data, total, dict } = await this.queueStatList(); let { data, total, dict } = await this.queueStatList();
data.forEach((v) => { data.forEach((v) => {
v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : ""; v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : '';
}); });
this.dict = dict; this.dict = dict;
this.total = total; this.total = total;
...@@ -191,22 +191,21 @@ export default { ...@@ -191,22 +191,21 @@ export default {
}, },
handleSearch(form) { handleSearch(form) {
let { type, businessName, deptName, windowNum, year, month, day } = form; let { type, businessName, deptName, windowNum, year, month, day } = form;
this.searchForm.year = ""; this.searchForm.year = '';
this.searchForm.month = ""; this.searchForm.month = '';
this.searchForm.day = ""; this.searchForm.day = '';
if (type == "year") { if (type == 'year') {
this.searchForm.groupList = ["year"]; this.searchForm.groupList = ['year'];
this.searchForm.year = year; this.searchForm.year = year;
} else if (type == "month") { } else if (type == 'month') {
this.searchForm.groupList = ["year", "month"]; this.searchForm.groupList = ['year', 'month'];
if (month) { if (month) {
[this.searchForm.year, this.searchForm.month] = month.split("-"); [this.searchForm.year, this.searchForm.month] = month.split('-');
} }
} else { } else {
this.searchForm.groupList = ["year", "month", "day"]; this.searchForm.groupList = ['year', 'month', 'day'];
if (day) { if (day) {
[this.searchForm.year, this.searchForm.month, this.searchForm.day] = [this.searchForm.year, this.searchForm.month, this.searchForm.day] = day.split('-');
day.split("-");
} }
} }
this.searchForm.businessList = businessName ? [businessName] : []; this.searchForm.businessList = businessName ? [businessName] : [];
...@@ -228,28 +227,28 @@ export default { ...@@ -228,28 +227,28 @@ export default {
tHeader, tHeader,
filterVal, filterVal,
data, data,
"排队数据汇总报表" + this.$moment().format("YYYYMMDDHHmmss") '排队数据汇总报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
} else { } else {
dataSection(this.queueStatList, {}, (data) => { dataSection(this.queueStatList, {}, (data) => {
if (!data.length) { if (!data.length) {
this.$message.warning("暂无数据"); this.$message.warning('暂无数据');
return; return;
} }
data.forEach((v) => { data.forEach((v) => {
v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : ""; v.waitTime = v.waitTime ? formatSeconds(v.waitTime) : '';
}); });
export2Excel( export2Excel(
tHeader, tHeader,
filterVal, filterVal,
data, data,
"排队数据汇总报表" + this.$moment().format("YYYYMMDDHHmmss") '排队数据汇总报表' + this.$moment().format('YYYYMMDDHHmmss')
); );
}); });
} }
this.exportLoading = false; this.exportLoading = false;
}, }
}, }
}; };
</script> </script>
......
<template> <template>
<div <div class="search mb-[15px] flex h-[170px] w-full flex-col items-center justify-around">
class="search mb-[15px] flex h-[170px] w-full flex-col items-center justify-around"
>
<div class="flex gap-10"> <div class="flex gap-10">
<router-link v-for="(v, i) in subMenus" :key="i" :to="v.path"> <router-link v-for="(v, i) in subMenus" :key="i" :to="v.path">
{{ v.meta.title }} {{ v.meta.title }}
...@@ -12,11 +10,7 @@ ...@@ -12,11 +10,7 @@
<div class="flex gap-2"> <div class="flex gap-2">
<div class="item border"> <div class="item border">
<span class="pl-[15px] text-[14px]">选择时间</span> <span class="pl-[15px] text-[14px]">选择时间</span>
<el-popover <el-popover trigger="click" placement="bottom-start" popper-class="search-popover">
trigger="click"
placement="bottom-start"
popper-class="search-popover"
>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<div class="tab-box"> <div class="tab-box">
<div <div
...@@ -75,10 +69,7 @@ ...@@ -75,10 +69,7 @@
></el-input> ></el-input>
</el-popover> </el-popover>
</div> </div>
<div <div class="item border" v-if="$route.path == '/enginesearch/queueupdata'">
class="item border"
v-if="$route.path == '/enginesearch/queueupdata'"
>
<span class="pl-[15px] text-[14px]">选择业务</span> <span class="pl-[15px] text-[14px]">选择业务</span>
<el-popover <el-popover
trigger="click" trigger="click"
...@@ -103,13 +94,8 @@ ...@@ -103,13 +94,8 @@
</div> </div>
</div> </div>
</div> </div>
<div <div v-else class="flex h-full w-full items-center justify-center">
v-else <el-empty :image="require('@/assets/img/empty.png')"></el-empty>
class="flex h-full w-full items-center justify-center"
>
<el-empty
:image="require('@/assets/img/empty.png')"
></el-empty>
</div> </div>
</div> </div>
<el-input <el-input
...@@ -131,12 +117,7 @@ ...@@ -131,12 +117,7 @@
filterable filterable
size="small" size="small"
> >
<el-option <el-option v-for="(v, i) in pjOption" :key="i" :label="v" :value="v"></el-option>
v-for="(v, i) in pjOption"
:key="i"
:label="v"
:value="v"
></el-option>
</el-select> </el-select>
</div> </div>
<div class="item border"> <div class="item border">
...@@ -164,13 +145,8 @@ ...@@ -164,13 +145,8 @@
</div> </div>
</div> </div>
</div> </div>
<div <div v-else class="flex h-full w-full items-center justify-center">
v-else <el-empty :image="require('@/assets/img/empty.png')"></el-empty>
class="flex h-full w-full items-center justify-center"
>
<el-empty
:image="require('@/assets/img/empty.png')"
></el-empty>
</div> </div>
</div> </div>
<el-input <el-input
...@@ -210,13 +186,8 @@ ...@@ -210,13 +186,8 @@
</div> </div>
</div> </div>
</div> </div>
<div <div v-else class="flex h-full w-full items-center justify-center">
v-else <el-empty :image="require('@/assets/img/empty.png')"></el-empty>
class="flex h-full w-full items-center justify-center"
>
<el-empty
:image="require('@/assets/img/empty.png')"
></el-empty>
</div> </div>
</div> </div>
<el-input <el-input
...@@ -238,14 +209,14 @@ ...@@ -238,14 +209,14 @@
</template> </template>
<script> <script>
import { findBottomSubarrays } from "@/utils"; import { findBottomSubarrays } from '@/utils';
export default { export default {
components: {}, components: {},
props: { props: {
dict: { dict: {
required: true, required: true,
default: () => {}, default: () => {}
}, }
}, },
data() { data() {
return { return {
...@@ -258,15 +229,15 @@ export default { ...@@ -258,15 +229,15 @@ export default {
sectionList: [], sectionList: [],
windowList: [], windowList: [],
form: { form: {
type: "year", type: 'year',
businessName: "", businessName: '',
deptName: "", deptName: '',
windowNum: "", windowNum: '',
year: "", year: '',
month: "", month: '',
day: "", day: '',
pjOption: "", pjOption: ''
}, }
}; };
}, },
computed: { computed: {
...@@ -274,9 +245,9 @@ export default { ...@@ -274,9 +245,9 @@ export default {
return this.$route.path; return this.$route.path;
}, },
dateInputVal() { dateInputVal() {
if (this.form.type == "year") { if (this.form.type == 'year') {
return this.form.year; return this.form.year;
} else if (this.form.type == "month") { } else if (this.form.type == 'month') {
return this.form.month; return this.form.month;
} else { } else {
return this.form.day; return this.form.day;
...@@ -288,7 +259,7 @@ export default { ...@@ -288,7 +259,7 @@ export default {
}, },
set(val) { set(val) {
this.calcBusiness = val; this.calcBusiness = val;
}, }
}, },
calcDeptList: { calcDeptList: {
get() { get() {
...@@ -296,7 +267,7 @@ export default { ...@@ -296,7 +267,7 @@ export default {
}, },
set(val) { set(val) {
this.calcDept = val; this.calcDept = val;
}, }
}, },
calcWindowList: { calcWindowList: {
get() { get() {
...@@ -304,8 +275,8 @@ export default { ...@@ -304,8 +275,8 @@ export default {
}, },
set(val) { set(val) {
this.calcWindow = val; this.calcWindow = val;
}, }
}, }
}, },
watch: { watch: {
dict: { dict: {
...@@ -313,8 +284,8 @@ export default { ...@@ -313,8 +284,8 @@ export default {
this.changeOptions(newVal); this.changeOptions(newVal);
}, },
deep: true, deep: true,
immediate: true, immediate: true
}, }
}, },
created() { created() {
this.getSubMenus(); this.getSubMenus();
...@@ -327,14 +298,10 @@ export default { ...@@ -327,14 +298,10 @@ export default {
// 获取当前顶层路由下的所有子路由 // 获取当前顶层路由下的所有子路由
getSubMenus() { getSubMenus() {
let path = this.$route?.meta.parentPath let path = this.$route?.meta.parentPath ? this.$route.meta.parentPath : this.$route.path;
? this.$route.meta.parentPath
: this.$route.path;
let options = this.$router.options.routes[0].children; let options = this.$router.options.routes[0].children;
let curRouters = options.filter((v) => v.path == path); let curRouters = options.filter((v) => v.path == path);
this.subMenus = findBottomSubarrays(curRouters).filter( this.subMenus = findBottomSubarrays(curRouters).filter((v) => !v.meta.hidden);
(v) => !v.meta.hidden
);
}, },
getTopKeyList(arr) { getTopKeyList(arr) {
...@@ -343,33 +310,29 @@ export default { ...@@ -343,33 +310,29 @@ export default {
// 获取搜索配置 // 获取搜索配置
changeOptions(dict) { changeOptions(dict) {
if (JSON.stringify(dict) == "{}") return; if (JSON.stringify(dict) == '{}') return;
let { businessList, sectionNameList, windowFromnumList, pjOption } = dict; let { businessList, sectionNameList, windowFromnumList, pjOption } = dict;
this.pjOption = pjOption ? pjOption : []; this.pjOption = pjOption ? pjOption : [];
this.calcBusiness = this.businessList = businessList this.calcBusiness = this.businessList = businessList ? this.getTopKeyList(businessList) : [];
? this.getTopKeyList(businessList) this.calcDept = this.sectionList = sectionNameList ? this.getTopKeyList(sectionNameList) : [];
: [];
this.calcDept = this.sectionList = sectionNameList
? this.getTopKeyList(sectionNameList)
: [];
this.calcWindow = this.windowList = windowFromnumList this.calcWindow = this.windowList = windowFromnumList
? this.getTopKeyList(windowFromnumList) ? this.getTopKeyList(windowFromnumList)
: []; : [];
}, },
changeTab(key) { changeTab(key) {
this.form.year = ""; this.form.year = '';
this.form.month = ""; this.form.month = '';
this.form.day = ""; this.form.day = '';
this.form.type = key; this.form.type = key;
}, },
handleClearDate() { handleClearDate() {
this.form.year = ""; this.form.year = '';
this.form.month = ""; this.form.month = '';
this.form.day = ""; this.form.day = '';
}, },
handleBusinessNameInput(name) { handleBusinessNameInput(name) {
if (name != "") { if (name != '') {
let list = this.businessList.filter((v) => v.includes(name)); let list = this.businessList.filter((v) => v.includes(name));
this.calcBusinessList = list.slice(0, 10); this.calcBusinessList = list.slice(0, 10);
} else { } else {
...@@ -377,7 +340,7 @@ export default { ...@@ -377,7 +340,7 @@ export default {
} }
}, },
handleDeptNameInput(name) { handleDeptNameInput(name) {
if (name != "") { if (name != '') {
let list = this.deptList.filter((v) => v.includes(name)); let list = this.deptList.filter((v) => v.includes(name));
this.calcDeptList = list.slice(0, 10); this.calcDeptList = list.slice(0, 10);
} else { } else {
...@@ -385,7 +348,7 @@ export default { ...@@ -385,7 +348,7 @@ export default {
} }
}, },
handleWindowInput(value) { handleWindowInput(value) {
if (value != "") { if (value != '') {
let list = this.windowList.filter((v) => v.includes(value)); let list = this.windowList.filter((v) => v.includes(value));
this.calcWindowList = list.slice(0, 10); this.calcWindowList = list.slice(0, 10);
} else { } else {
...@@ -393,29 +356,28 @@ export default { ...@@ -393,29 +356,28 @@ export default {
} }
}, },
handleSearch() { handleSearch() {
this.$emit("search", this.form); this.$emit('search', this.form);
}, },
handleShowPopper(type) { handleShowPopper(type) {
switch (type) { switch (type) {
case "business": case 'business':
this.calcBusinessList = this.businessList.slice(0, 10); this.calcBusinessList = this.businessList.slice(0, 10);
break; break;
case "deptName": case 'deptName':
this.calcDeptList = this.sectionList.slice(0, 10); this.calcDeptList = this.sectionList.slice(0, 10);
break; break;
case "window": case 'window':
this.calcWindowList = this.windowList.slice(0, 10); this.calcWindowList = this.windowList.slice(0, 10);
} }
}, }
}, }
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.search { .search {
flex-shrink: 0; flex-shrink: 0;
background: url("@/assets/img/engineSearch_bg.svg") no-repeat center / 100% background: url('@/assets/img/engineSearch_bg.svg') no-repeat center / 100% 100%;
100%;
a { a {
color: rgba(254, 254, 254, 0.65); color: rgba(254, 254, 254, 0.65);
} }
......
<template> <template>
<div <div
:class="[ :class="['area-card', 'is-hover', tag.length ? 'cursor-pointer' : 'cursor-not-allowed']"
'area-card',
'is-hover',
tag.length ? 'cursor-pointer' : 'cursor-not-allowed',
]"
@click="handleClick" @click="handleClick"
> >
<div class="banner"> <div class="banner">
...@@ -14,9 +10,7 @@ ...@@ -14,9 +10,7 @@
<!-- 对接时间 --> <!-- 对接时间 -->
<div class="w-full"> <div class="w-full">
<span class="time" v-if="isAccess"> <span class="time" v-if="isAccess">
对接时间:<span v-if="data.accessTime">{{ 对接时间:<span v-if="data.accessTime">{{ data.accessTime | dateDayFormat }}</span>
data.accessTime | dateDayFormat
}}</span>
</span> </span>
</div> </div>
<!-- name --> <!-- name -->
...@@ -36,8 +30,8 @@ export default { ...@@ -36,8 +30,8 @@ export default {
type: Object, type: Object,
default() { default() {
return {}; return {};
}, }
}, }
}, },
data() { data() {
return {}; return {};
...@@ -45,7 +39,7 @@ export default { ...@@ -45,7 +39,7 @@ export default {
computed: { computed: {
tag() { tag() {
if (this.data.tag) { if (this.data.tag) {
return this.data.tag.split(","); return this.data.tag.split(',');
} else { } else {
return []; return [];
} }
...@@ -58,21 +52,21 @@ export default { ...@@ -58,21 +52,21 @@ export default {
} else { } else {
return false; return false;
} }
}, }
}, },
methods: { methods: {
handleClick() { handleClick() {
if (this.tag.length) { if (this.tag.length) {
this.$emit("click", this.data); this.$emit('click', this.data);
this.$router.push({ this.$router.push({
name: "queueupreport", name: 'queueupreport',
params: { params: {
siteId: this.data.siteId + "", siteId: this.data.siteId + ''
}, }
}); });
} }
}, }
}, }
}; };
</script> </script>
......
<template> <template>
<div <div
:class="[ :class="['card', info.systemList.length ? 'cursor-pointer' : 'cursor-not-allowed']"
'card',
info.systemList.length ? 'cursor-pointer' : 'cursor-not-allowed',
]"
@click="handleClick" @click="handleClick"
> >
<div>{{ info.name }}</div> <div>{{ info.name }}</div>
<el-tag <el-tag size="small" type="danger" color="#fff" v-if="!info.systemList.length">
size="small"
type="danger"
color="#fff"
v-if="!info.systemList.length"
>
<i class="el-icon-link"></i> <i class="el-icon-link"></i>
等待对接</el-tag 等待对接</el-tag
> >
<div class="cur flex gap-2" v-else> <div class="cur flex gap-2" v-else>
<el-tag v-for="(v, i) in info.systemList" :key="i" size="small">{{ <el-tag v-for="(v, i) in info.systemList" :key="i" size="small">{{ v }}</el-tag>
v
}}</el-tag>
</div>
<div class="card-date" v-if="info.systemList.length">
对接时间:{{ info.date }}
</div> </div>
<div class="card-date" v-if="info.systemList.length">对接时间:{{ info.date }}</div>
<div class="mask" v-else></div> <div class="mask" v-else></div>
</div> </div>
</template> </template>
...@@ -35,8 +23,8 @@ export default { ...@@ -35,8 +23,8 @@ export default {
type: Object, type: Object,
default() { default() {
return {}; return {};
}, }
}, }
}, },
data() { data() {
return {}; return {};
...@@ -44,10 +32,10 @@ export default { ...@@ -44,10 +32,10 @@ export default {
methods: { methods: {
handleClick() { handleClick() {
if (this.info.systemList.length) { if (this.info.systemList.length) {
this.$emit("click", this.info); this.$emit('click', this.info);
} }
}, }
}, }
}; };
</script> </script>
...@@ -56,7 +44,7 @@ export default { ...@@ -56,7 +44,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #fff; color: #fff;
background: url("@/assets/img/changningxian.png") no-repeat center / 100% 100%; background: url('@/assets/img/changningxian.png') no-repeat center / 100% 100%;
border-radius: 4px; border-radius: 4px;
color: #fff; color: #fff;
position: relative; position: relative;
......
...@@ -2,37 +2,32 @@ ...@@ -2,37 +2,32 @@
<div class="carousel"> <div class="carousel">
<div class="swiper-container"> <div class="swiper-container">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<img <img class="swiper-slide" v-for="(v, index) in ImageArray" :key="index" :src="v" />
class="swiper-slide"
v-for="(v, index) in ImageArray"
:key="index"
:src="v"
/>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Swiper from "swiper"; import Swiper from 'swiper';
export default { export default {
props: { props: {
ImageArray: { ImageArray: {
type: Array, type: Array,
default: () => { default: () => {
return []; return [];
}, }
}, },
speed: { speed: {
type: Number, type: Number,
default: 1500, default: 1500
}, }
}, },
data() { data() {
return { return {
currentIndex: 0, currentIndex: 0,
timer: null, timer: null,
mySwiper: null, mySwiper: null
}; };
}, },
watch: {}, watch: {},
...@@ -41,22 +36,22 @@ export default { ...@@ -41,22 +36,22 @@ export default {
}, },
methods: { methods: {
initSwiper() { initSwiper() {
this.mySwiper = new Swiper(".swiper-container", { this.mySwiper = new Swiper('.swiper-container', {
autoplay: true, autoplay: true,
effect: "fade", effect: 'fade',
fadeEffect: true, fadeEffect: true,
speed: this.speed, speed: this.speed,
loop: true, loop: true,
updateOnWindowResize: true, updateOnWindowResize: true,
watchSlidesProgress: true, watchSlidesProgress: true
}); });
this.mySwiper.init(); this.mySwiper.init();
}, }
}, },
beforeDestroy() { beforeDestroy() {
this.mySwiper.destroy(); this.mySwiper.destroy();
}, }
}; };
</script> </script>
......
...@@ -7,21 +7,21 @@ export default { ...@@ -7,21 +7,21 @@ export default {
props: { props: {
dataset: { dataset: {
type: Object, type: Object,
default: () => {}, default: () => {}
}, },
endValue: { endValue: {
type: Number, type: Number,
default: 10, default: 10
}, },
color: { color: {
type: String, type: String,
default: "#0857E8", default: '#0857E8'
}, }
}, },
data() { data() {
return { return {
myChart: null, myChart: null,
timer: null, timer: null
}; };
}, },
watch: { watch: {
...@@ -32,8 +32,8 @@ export default { ...@@ -32,8 +32,8 @@ export default {
}); });
}, },
deep: true, deep: true,
immediate: true, immediate: true
}, }
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -52,13 +52,13 @@ export default { ...@@ -52,13 +52,13 @@ export default {
let option = { let option = {
grid: { grid: {
top: "15%", top: '15%',
left: "15%", left: '15%',
right: "5%", right: '5%',
bottom: "12%", bottom: '12%'
}, },
tooltip: { tooltip: {
trigger: "axis", trigger: 'axis',
borderWidth: 0, borderWidth: 0,
formatter: (params) => { formatter: (params) => {
return `${ return `${
...@@ -66,12 +66,10 @@ export default { ...@@ -66,12 +66,10 @@ export default {
}<br/><div style='margin-top:4px;padding:4px 8px;background:${this.hexToRgba( }<br/><div style='margin-top:4px;padding:4px 8px;background:${this.hexToRgba(
this.color, this.color,
0.1 0.1
)};color:${ )};color:${this.color};border-radius:4px'><span style='margin-right:20px'>${
this.color
};border-radius:4px'><span style='margin-right:20px'>${
params[0].seriesName params[0].seriesName
}</span>${params[0].value.value}</div>`; }</span>${params[0].value.value}</div>`;
}, }
}, },
// dataZoom: [ // dataZoom: [
// { // {
...@@ -82,77 +80,77 @@ export default { ...@@ -82,77 +80,77 @@ export default {
// }, // },
// ], // ],
xAxis: { xAxis: {
type: "category", type: 'category',
boundaryGap: false, boundaryGap: false,
axisLabel: { axisLabel: {
color: "#5A5C60", color: '#5A5C60',
formatter: (name) => { formatter: (name) => {
let formatterName = name.split("-"); let formatterName = name.split('-');
return `${formatterName[1]}-${formatterName[2]}`; return `${formatterName[1]}-${formatterName[2]}`;
}, }
}, },
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: "#E0E0E0", color: '#E0E0E0'
}, }
}, },
axisTick: { axisTick: {
show: false, show: false
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
type: "dashed", type: 'dashed',
color: "#E0E0E0", color: '#E0E0E0'
}, }
}, },
axisPointer: { axisPointer: {
lineStyle: { lineStyle: {
color: this.hexToRgba(this.color, 1), color: this.hexToRgba(this.color, 1)
}, }
}, }
}, },
yAxis: { yAxis: {
type: "value", type: 'value',
splitNumber: 3, splitNumber: 3,
axisLabel: { axisLabel: {
color: "#666", color: '#666'
}, },
nameTextStyle: { nameTextStyle: {
color: "#5A5C60", color: '#5A5C60',
fontSize: 12, fontSize: 12,
lineHeight: 40, lineHeight: 40
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
type: "dashed", type: 'dashed',
color: "#E0E0E0", color: '#E0E0E0'
}, }
}, },
axisLine: { axisLine: {
show: false, show: false
}, },
axisTick: { axisTick: {
show: false, show: false
}, }
}, },
series: [ series: [
{ {
name: "数据量", name: '数据量',
type: "line", type: 'line',
smooth: true, smooth: true,
showSymbol: false, showSymbol: false,
symbolSize: 8, symbolSize: 8,
lineStyle: { lineStyle: {
color: this.hexToRgba(this.color, 1), color: this.hexToRgba(this.color, 1)
}, },
itemStyle: { itemStyle: {
color: this.hexToRgba(this.color, 1), color: this.hexToRgba(this.color, 1)
}, },
areaStyle: { areaStyle: {
color: { color: {
type: "linear", type: 'linear',
x: 0, x: 0,
y: 0, y: 0,
x2: 0, x2: 0,
...@@ -160,28 +158,28 @@ export default { ...@@ -160,28 +158,28 @@ export default {
colorStops: [ colorStops: [
{ {
offset: 0, offset: 0,
color: this.hexToRgba(this.color, 0.4), color: this.hexToRgba(this.color, 0.4)
}, },
{ {
offset: 0.6, offset: 0.6,
color: this.hexToRgba(this.color, 0.1), color: this.hexToRgba(this.color, 0.1)
}, },
{ {
offset: 1, offset: 1,
color: "#0000", color: '#0000'
}, }
], ]
}, }
}, }
}, }
], ],
dataset, dataset
}; };
this.myChart.setOption(option); this.myChart.setOption(option);
// 适配 // 适配
window.addEventListener("resize", this.adapterEcharts); window.addEventListener('resize', this.adapterEcharts);
// 清除现有定时器,防止多次调用 // 清除现有定时器,防止多次调用
// clearInterval(this.timer); // clearInterval(this.timer);
...@@ -221,20 +219,20 @@ export default { ...@@ -221,20 +219,20 @@ export default {
}, },
hexToRgba(hex, opacity) { hexToRgba(hex, opacity) {
let rgbaColor = ""; let rgbaColor = '';
let reg = /^#[\da-f]{6}$/i; let reg = /^#[\da-f]{6}$/i;
if (reg.test(hex)) { if (reg.test(hex)) {
rgbaColor = `rgba(${parseInt("0x" + hex.slice(1, 3))},${parseInt( rgbaColor = `rgba(${parseInt('0x' + hex.slice(1, 3))},${parseInt(
"0x" + hex.slice(3, 5) '0x' + hex.slice(3, 5)
)},${parseInt("0x" + hex.slice(5, 7))},${opacity})`; )},${parseInt('0x' + hex.slice(5, 7))},${opacity})`;
} }
return rgbaColor; return rgbaColor;
}, }
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener("resize", this.adapterEcharts); window.removeEventListener('resize', this.adapterEcharts);
clearInterval(this.timer); clearInterval(this.timer);
}, }
}; };
</script> </script>
......
...@@ -3,13 +3,7 @@ ...@@ -3,13 +3,7 @@
<div class="page page-login flex h-full w-full items-center justify-center"> <div class="page page-login flex h-full w-full items-center justify-center">
<div class="flex min-w-[450px] flex-col justify-center bg-white p-[25px]"> <div class="flex min-w-[450px] flex-col justify-center bg-white p-[25px]">
<h1 class="mb-4 text-center text-[24px] font-[500]">{{ systemName }}</h1> <h1 class="mb-4 text-center text-[24px] font-[500]">{{ systemName }}</h1>
<el-form <el-form class="w-full" ref="form" :model="form" :rules="rules" hide-required-asterisk>
class="w-full"
ref="form"
:model="form"
:rules="rules"
hide-required-asterisk
>
<el-form-item l prop="loginName"> <el-form-item l prop="loginName">
<el-input <el-input
clearable clearable
...@@ -38,14 +32,8 @@ ...@@ -38,14 +32,8 @@
v-model="form.securityCode" v-model="form.securityCode"
@keyup.enter="onSubmit" @keyup.enter="onSubmit"
></el-input> ></el-input>
<div <div class="code-box h-[40px] cursor-pointer overflow-hidden rounded-[4px]">
class="code-box h-[40px] cursor-pointer overflow-hidden rounded-[4px]" <img class="h-full w-full" :src="securityUrl" @click="createCode" />
>
<img
class="h-full w-full"
:src="securityUrl"
@click="createCode"
/>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
...@@ -67,52 +55,48 @@ ...@@ -67,52 +55,48 @@
</template> </template>
<script> <script>
import storage from "@/utils/storage"; import storage from '@/utils/storage';
import { mapMutations } from "vuex"; import { mapMutations } from 'vuex';
import { getHomeData } from "@/api/home"; import { getHomeData } from '@/api/home';
import { generateRoutes, filterBtn } from "@/utils"; import { generateRoutes, filterBtn } from '@/utils';
import { calcMenu } from "@/router"; import { calcMenu } from '@/router';
import { login } from "@/api/login"; import { login } from '@/api/login';
import { systemName } from "@/config"; import { systemName } from '@/config';
export default { export default {
name: "login", name: 'login',
data() { data() {
return { return {
systemName, systemName,
api: process.env.VUE_APP_API_BASE_URL, api: process.env.VUE_APP_API_BASE_URL,
securityUrl: "", securityUrl: '',
originData: [], originData: [],
loading: false, loading: false,
redirect: this.$route.query.redirect || "/", redirect: this.$route.query.redirect || '/',
form: { form: {
loginName: "", loginName: '',
password: "", password: '',
securityCode: "", securityCode: ''
}, },
rules: { rules: {
loginName: [ loginName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
{ required: true, message: "请输入用户名", trigger: "blur" }, password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
], securityCode: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
password: [{ required: true, message: "请输入密码", trigger: "blur" }], }
securityCode: [
{ required: true, message: "请输入验证码", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
this.createCode(); this.createCode();
}, },
methods: { methods: {
...mapMutations("user", [ ...mapMutations('user', [
"SET_token", 'SET_token',
"SET_sysName", 'SET_sysName',
"SET_sysLogo", 'SET_sysLogo',
"SET_path", 'SET_path',
"SET_userInfo", 'SET_userInfo',
"SET_permissions", 'SET_permissions',
"SET_routes", 'SET_routes',
"SET_menusList", 'SET_menusList'
]), ]),
// 获取验证码 // 获取验证码
...@@ -120,8 +104,7 @@ export default { ...@@ -120,8 +104,7 @@ export default {
// 加时间戳印记用于刷新gif // 加时间戳印记用于刷新gif
let mark = new Date().getTime(); let mark = new Date().getTime();
// this.form.mark = mark; // this.form.mark = mark;
this.securityUrl = this.securityUrl = this.api + '/bill/securitycode/createCode' + `?mark=${mark}`;
this.api + "/bill/securitycode/createCode" + `?mark=${mark}`;
}, },
onSubmit() { onSubmit() {
...@@ -132,17 +115,17 @@ export default { ...@@ -132,17 +115,17 @@ export default {
if (res.data.code == 1) { if (res.data.code == 1) {
let { let {
token, token,
user: { id, loginName, siteIds }, user: { id, loginName, siteIds }
} = res.data.data; } = res.data.data;
let form = { let form = {
token, token,
userInfo: { userInfo: {
id, id,
name: loginName, name: loginName
}, }
}; };
if (siteIds) { if (siteIds) {
let siteid = siteIds.split(",")[0]; let siteid = siteIds.split(',')[0];
form.siteid = siteid; form.siteid = siteid;
} }
await this.getToken(form); await this.getToken(form);
...@@ -157,11 +140,11 @@ export default { ...@@ -157,11 +140,11 @@ export default {
if (token && userInfo) { if (token && userInfo) {
this.SET_userInfo(userInfo); this.SET_userInfo(userInfo);
this.SET_token(token); this.SET_token(token);
storage.set(2, "siteId", siteid); storage.set(2, 'siteId', siteid);
// storage.set(2, "siteName", siteName); // storage.set(2, "siteName", siteName);
await this.getIndixData(); await this.getIndixData();
} else { } else {
this.$message.warning("登录失败,请稍后再试"); this.$message.warning('登录失败,请稍后再试');
} }
}, },
// 获取菜单列表 // 获取菜单列表
...@@ -180,7 +163,7 @@ export default { ...@@ -180,7 +163,7 @@ export default {
let path = routes[0].path; let path = routes[0].path;
this.$router.push(path); this.$router.push(path);
} else { } else {
this.$message.warning("暂无权限,请联系管理员!"); this.$message.warning('暂无权限,请联系管理员!');
} }
} }
}, },
...@@ -191,8 +174,8 @@ export default { ...@@ -191,8 +174,8 @@ export default {
.filter((v) => v.perms) .filter((v) => v.perms)
.map((v) => v.perms); .map((v) => v.perms);
this.SET_permissions(btnPermissions); this.SET_permissions(btnPermissions);
}, }
}, }
}; };
</script> </script>
......
This diff is collapsed.
<template> <template>
<div class="flex h-full w-full gap-5"> <div class="flex h-full w-full gap-5">
<div <div class="area-tree-box flex h-full w-[20%] flex-col rounded-[4px] bg-white">
class="area-tree-box flex h-full w-[20%] flex-col rounded-[4px] bg-white"
>
<TabHeader icon="el-icon-notebook-2" label="组织架构"></TabHeader> <TabHeader icon="el-icon-notebook-2" label="组织架构"></TabHeader>
<div class="w-full flex-1 overflow-auto p-[20px]"> <div class="w-full flex-1 overflow-auto p-[20px]">
<AreaTree @change="changeSite"></AreaTree> <AreaTree @change="changeSite"></AreaTree>
...@@ -12,10 +10,7 @@ ...@@ -12,10 +10,7 @@
<el-tabs :value="activeKey" @tab-click="changeRouter"> <el-tabs :value="activeKey" @tab-click="changeRouter">
<el-tab-pane v-for="v in secondaryRoutes" :key="v.path" :name="v.path"> <el-tab-pane v-for="v in secondaryRoutes" :key="v.path" :name="v.path">
<template slot="label"> <template slot="label">
<i <i v-if="v.meta.icon" :class="['mr-[5px]', 'primary', v.meta.icon]"></i>
v-if="v.meta.icon"
:class="['mr-[5px]', 'primary', v.meta.icon]"
></i>
<span class="tab-label">{{ v.meta.title }}</span> <span class="tab-label">{{ v.meta.title }}</span>
</template> </template>
</el-tab-pane> </el-tab-pane>
...@@ -28,18 +23,18 @@ ...@@ -28,18 +23,18 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
return { return {
curTreeData: {}, // 当前选择的站点 curTreeData: {} // 当前选择的站点
}; };
}, },
computed: { computed: {
...mapGetters("user", ["secondaryRoutes"]), ...mapGetters('user', ['secondaryRoutes']),
activeKey() { activeKey() {
return this.$route.path; return this.$route.path;
}, }
}, },
created() {}, created() {},
methods: { methods: {
...@@ -51,8 +46,8 @@ export default { ...@@ -51,8 +46,8 @@ export default {
changeSite(data) { changeSite(data) {
this.curTreeData = data; this.curTreeData = data;
// this.$refs.Page.getSite(data); // this.$refs.Page.getSite(data);
}, }
}, }
}; };
</script> </script>
......
This diff is collapsed.
<template> <template>
<el-drawer <el-drawer title="详情" :visible.sync="drawer" size="60%" @close="drawer = false">
title="详情"
:visible.sync="drawer"
size="60%"
@close="drawer = false"
>
<div class="main h-full w-full p-[20px]"> <div class="main h-full w-full p-[20px]">
<el-descriptions <el-descriptions :column="3" border size="medium" labelClassName="label-name">
:column="3"
border
size="medium"
labelClassName="label-name"
>
<template v-for="(v, i) in dataInfo"> <template v-for="(v, i) in dataInfo">
<el-descriptions-item <el-descriptions-item
v-if=" v-if="(v.prop == 'photoautograph' || v.prop == 'picture') && v.content"
(v.prop == 'photoautograph' || v.prop == 'picture') && v.content
"
:key="i" :key="i"
:label="v.title" :label="v.title"
> >
<el-image <el-image style="width: 50px" :src="v.content" :preview-src-list="[v.content]">
style="width: 50px"
:src="v.content"
:preview-src-list="[v.content]"
>
</el-image> </el-image>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-else :key="i" :label="v.title"> <el-descriptions-item v-else :key="i" :label="v.title">
...@@ -41,168 +25,168 @@ export default { ...@@ -41,168 +25,168 @@ export default {
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
info: { info: {
required: true, required: true,
type: Object, type: Object,
default: () => {}, default: () => {}
}, }
}, },
data() { data() {
return { return {
detailsList: [ detailsList: [
{ {
title: "身份证号", title: '身份证号',
prop: "peopleIdcard", prop: 'peopleIdcard',
content: "", content: ''
}, },
{ {
title: "姓名", title: '姓名',
prop: "peopleName", prop: 'peopleName',
content: "", content: ''
}, },
{ {
title: "性别", title: '性别',
prop: "peopleSex", prop: 'peopleSex',
content: "", content: ''
}, },
{ {
title: "手机号", title: '手机号',
prop: "peoplePhone", prop: 'peoplePhone',
content: "", content: ''
}, },
{ {
title: "评价选项", title: '评价选项',
prop: "pjOption", prop: 'pjOption',
content: "", content: ''
}, },
{ {
title: "评价标签", title: '评价标签',
prop: "contentTag", prop: 'contentTag',
content: "", content: ''
}, },
{ {
title: "评价人图片地址", title: '评价人图片地址',
prop: "picUrl", prop: 'picUrl',
content: "", content: ''
}, },
{ {
title: "部门", title: '部门',
prop: "sectionName", prop: 'sectionName',
content: "", content: ''
}, },
{ {
title: "大厅名称", title: '大厅名称',
prop: "hallName", prop: 'hallName',
content: "", content: ''
}, },
{ {
title: "评价来源", title: '评价来源',
prop: "pjSource", prop: 'pjSource',
content: "", content: ''
}, },
{ {
title: "手输意见", title: '手输意见',
prop: "opinion", prop: 'opinion',
content: "", content: ''
}, },
{ {
title: "窗口名称", title: '窗口名称',
prop: "windowName", prop: 'windowName',
content: "", content: ''
}, },
{ {
title: "窗口编号", title: '窗口编号',
prop: "windowFromnum", prop: 'windowFromnum',
content: "", content: ''
}, },
{ {
title: "排队编号", title: '排队编号',
prop: "flounum", prop: 'flounum',
content: "", content: ''
}, },
{ {
title: "窗口评价", title: '窗口评价',
prop: "pjxt", prop: 'pjxt',
content: "", content: ''
}, },
{ {
title: "工作人员姓名", title: '工作人员姓名',
prop: "workmanName", prop: 'workmanName',
content: "", content: ''
}, },
{ {
title: "工作人员工号", title: '工作人员工号',
prop: "workmanNumber", prop: 'workmanNumber',
content: "", content: ''
}, },
{ {
title: "评价器MAC地址", title: '评价器MAC地址',
prop: "devicenum", prop: 'devicenum',
content: "", content: ''
}, },
{ {
title: "评价状态", title: '评价状态',
prop: "evaluatestatus", prop: 'evaluatestatus',
content: "", content: ''
}, },
{ {
title: "截图还是评价", title: '截图还是评价',
prop: "evaluatetype", prop: 'evaluatetype',
content: "", content: ''
}, },
{ {
title: "截图地址", title: '截图地址',
prop: "photobefor", prop: 'photobefor',
content: "", content: ''
}, },
{ {
title: "签字图片", title: '签字图片',
prop: "photoautograph", prop: 'photoautograph',
content: "", content: ''
}, },
{ {
title: "抓拍评价人照片", title: '抓拍评价人照片',
prop: "picture", prop: 'picture',
content: "", content: ''
}, },
{ {
title: "音视频地址", title: '音视频地址',
prop: "process", prop: 'process',
content: "", content: ''
}, },
{ {
title: "评价标记", title: '评价标记',
prop: "eyevaluate", prop: 'eyevaluate',
content: "", content: ''
}, },
{ {
title: "评价指向", title: '评价指向',
prop: "pjType", prop: 'pjType',
content: "", content: ''
}, },
{ {
title: "评价时间", title: '评价时间',
prop: "pjTime", prop: 'pjTime',
content: "", content: ''
}, },
{ {
title: "站点编码", title: '站点编码',
prop: "siteCode", prop: 'siteCode',
content: "", content: ''
}, },
{ {
title: "站点名称", title: '站点名称',
prop: "siteName", prop: 'siteName',
content: "", content: ''
}, },
{ {
title: "扩展编号", title: '扩展编号',
prop: "extNum", prop: 'extNum',
content: "", content: ''
}, }
], ]
}; };
}, },
computed: { computed: {
...@@ -211,17 +195,17 @@ export default { ...@@ -211,17 +195,17 @@ export default {
return this.show; return this.show;
}, },
set(val) { set(val) {
this.$emit("update:show", val); this.$emit('update:show', val);
}, }
}, },
dataInfo() { dataInfo() {
this.detailsList.forEach((v) => { this.detailsList.forEach((v) => {
v.content = this.info[v.prop]; v.content = this.info[v.prop];
}); });
return this.detailsList; return this.detailsList;
}, }
}, },
methods: {}, methods: {}
}; };
</script> </script>
......
<template> <template>
<el-drawer <el-drawer title="详情" :visible.sync="drawer" size="60%" @close="drawer = false">
title="详情"
:visible.sync="drawer"
size="60%"
@close="drawer = false"
>
<div class="main h-full w-full p-[20px]"> <div class="main h-full w-full p-[20px]">
<el-descriptions <el-descriptions :column="3" border size="medium" labelClassName="label-name">
:column="3" <el-descriptions-item v-for="(v, i) in dataInfo" :key="i" :label="v.title">
border
size="medium"
labelClassName="label-name"
>
<el-descriptions-item
v-for="(v, i) in dataInfo"
:key="i"
:label="v.title"
>
{{ v.content }} {{ v.content }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
...@@ -29,158 +15,158 @@ export default { ...@@ -29,158 +15,158 @@ export default {
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
info: { info: {
required: true, required: true,
type: Object, type: Object,
default: () => {}, default: () => {}
}, }
}, },
data() { data() {
return { return {
detailsList: [ detailsList: [
{ {
title: "预约编号", title: '预约编号',
prop: "ordernumber", prop: 'ordernumber',
content: "", content: ''
}, },
{ {
title: "叫号状态", title: '叫号状态',
prop: "style", prop: 'style',
content: "", content: ''
}, },
{ {
title: "业务名称", title: '业务名称',
prop: "business", prop: 'business',
content: "", content: ''
}, },
{ {
title: "窗口名称", title: '窗口名称',
prop: "windowName", prop: 'windowName',
content: "", content: ''
}, },
{ {
title: "窗口编号", title: '窗口编号',
prop: "windowFromnum", prop: 'windowFromnum',
content: "", content: ''
}, },
{ {
title: "流水编号,当天的第xxx号", title: '流水编号,当天的第xxx号',
prop: "flownum", prop: 'flownum',
content: "", content: ''
}, },
{ {
title: "呼叫转移号", title: '呼叫转移号',
prop: "formernum", prop: 'formernum',
content: "", content: ''
}, },
{ {
title: "姓名", title: '姓名',
prop: "peopleName", prop: 'peopleName',
content: "", content: ''
}, },
{ {
title: "身份证号", title: '身份证号',
prop: "peopleIdcard", prop: 'peopleIdcard',
content: "", content: ''
}, },
{ {
title: "性别", title: '性别',
prop: "peopleSex", prop: 'peopleSex',
content: "", content: ''
}, },
{ {
title: "手机号", title: '手机号',
prop: "peoplePhone", prop: 'peoplePhone',
content: "", content: ''
}, },
{ {
title: "工作人员姓名", title: '工作人员姓名',
prop: "workmanName", prop: 'workmanName',
content: "", content: ''
}, },
{ {
title: "工作人员工号", title: '工作人员工号',
prop: "workmanNumber", prop: 'workmanNumber',
content: "", content: ''
}, },
{ {
title: "取号时间", title: '取号时间',
prop: "taketime", prop: 'taketime',
content: "", content: ''
}, },
{ {
title: "叫号时间", title: '叫号时间',
prop: "calltime", prop: 'calltime',
content: "", content: ''
}, },
{ {
title: "结束时间", title: '结束时间',
prop: "endtime", prop: 'endtime',
content: "", content: ''
}, },
{ {
title: "等待时间", title: '等待时间',
prop: "waitTime", prop: 'waitTime',
content: "", content: ''
}, },
{ {
title: "办理时间", title: '办理时间',
prop: "handleTime", prop: 'handleTime',
content: "", content: ''
}, },
{ {
title: "取号设备类型", title: '取号设备类型',
prop: "deviceType", prop: 'deviceType',
content: "", content: ''
}, },
{ {
title: "取号设备名称", title: '取号设备名称',
prop: "deviceName", prop: 'deviceName',
content: "", content: ''
}, },
{ {
title: "呼叫设备", title: '呼叫设备',
prop: "callName", prop: 'callName',
content: "", content: ''
}, },
{ {
title: "事项名称", title: '事项名称',
prop: "matterName", prop: 'matterName',
content: "", content: ''
}, },
{ {
title: "排号队列ID,唯一", title: '排号队列ID,唯一',
prop: "queueid", prop: 'queueid',
content: "", content: ''
}, },
{ {
title: "大厅名称", title: '大厅名称',
prop: "hallName", prop: 'hallName',
content: "测试", content: '测试'
}, },
{ {
title: "站点ID", title: '站点ID',
prop: "siteId", prop: 'siteId',
content: "", content: ''
}, },
{ {
title: "站点编码", title: '站点编码',
prop: "siteCode", prop: 'siteCode',
content: "", content: ''
}, },
{ {
title: "站点名称", title: '站点名称',
prop: "siteName", prop: 'siteName',
content: "", content: ''
}, },
{ {
title: "扩展编号", title: '扩展编号',
prop: "extNum", prop: 'extNum',
content: "", content: ''
}, }
], ]
}; };
}, },
computed: { computed: {
...@@ -189,17 +175,17 @@ export default { ...@@ -189,17 +175,17 @@ export default {
return this.show; return this.show;
}, },
set(val) { set(val) {
this.$emit("update:show", val); this.$emit('update:show', val);
}, }
}, },
dataInfo() { dataInfo() {
this.detailsList.forEach((v) => { this.detailsList.forEach((v) => {
v.content = this.info[v.prop]; v.content = this.info[v.prop];
}); });
return this.detailsList; return this.detailsList;
}, }
}, },
methods: {}, methods: {}
}; };
</script> </script>
......
...@@ -5,35 +5,34 @@ ...@@ -5,35 +5,34 @@
</template> </template>
<script> <script>
import storage from "@/utils/storage"; import storage from '@/utils/storage';
import { mapMutations } from "vuex"; import { mapMutations } from 'vuex';
import { getHomeData } from "@/api/home"; import { getHomeData } from '@/api/home';
import { generateRoutes, filterBtn } from "@/utils"; import { generateRoutes, filterBtn } from '@/utils';
import { calcMenu } from "@/router"; import { calcMenu } from '@/router';
export default { export default {
data() { data() {
return { return {
menuList: [], menuList: []
}; };
}, },
created() { created() {
this.getToken(); this.getToken();
}, },
methods: { methods: {
...mapMutations("user", [ ...mapMutations('user', [
"SET_token", 'SET_token',
"SET_sysName", 'SET_sysName',
"SET_sysLogo", 'SET_sysLogo',
"SET_path", 'SET_path',
"SET_userInfo", 'SET_userInfo',
"SET_permissions", 'SET_permissions',
"SET_routes", 'SET_routes',
"SET_menusList", 'SET_menusList'
]), ]),
// 获取token // 获取token
async getToken() { async getToken() {
let { token, userInfo, siteid, siteName, sysName, sysLogo, path } = let { token, userInfo, siteid, siteName, sysName, sysLogo, path } = this.$route.query;
this.$route.query;
if (token && userInfo) { if (token && userInfo) {
userInfo = JSON.parse(userInfo); userInfo = JSON.parse(userInfo);
this.SET_userInfo(userInfo); this.SET_userInfo(userInfo);
...@@ -41,11 +40,11 @@ export default { ...@@ -41,11 +40,11 @@ export default {
this.SET_sysName(sysName); this.SET_sysName(sysName);
this.SET_sysLogo(sysLogo); this.SET_sysLogo(sysLogo);
this.SET_path(path); this.SET_path(path);
storage.set(2, "siteId", siteid); storage.set(2, 'siteId', siteid);
storage.set(2, "siteName", siteName); storage.set(2, 'siteName', siteName);
await this.getIndixData(); await this.getIndixData();
} else { } else {
this.$message.warning("跳转失败,请重新登录"); this.$message.warning('跳转失败,请重新登录');
setTimeout(() => { setTimeout(() => {
location.href = process.env.VUE_APP_API_portal_URL; location.href = process.env.VUE_APP_API_portal_URL;
}, 2000); }, 2000);
...@@ -67,7 +66,7 @@ export default { ...@@ -67,7 +66,7 @@ export default {
let path = routes[0].path; let path = routes[0].path;
this.$router.push(path); this.$router.push(path);
} else { } else {
this.$message.warning("暂无权限,请联系管理员!"); this.$message.warning('暂无权限,请联系管理员!');
} }
} }
}, },
...@@ -78,8 +77,8 @@ export default { ...@@ -78,8 +77,8 @@ export default {
.filter((v) => v.perms) .filter((v) => v.perms)
.map((v) => v.perms); .map((v) => v.perms);
this.SET_permissions(btnPermissions); this.SET_permissions(btnPermissions);
}, }
}, }
}; };
</script> </script>
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
export default { export default {
data() { data() {
return { return {
subMenus: [], subMenus: []
}; };
}, },
computed: {}, computed: {},
created() {}, created() {},
methods: {}, methods: {}
}; };
</script> </script>
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<div class="h-full w-full"> <div class="h-full w-full">
<TableHeader> <TableHeader>
<div slot="left"> <div slot="left">
<el-button <el-button size="small" type="primary" v-hasPermi="['system:access:add']" @click="handleAdd"
size="small"
type="primary"
v-hasPermi="['system:access:add']"
@click="handleAdd"
>新增</el-button >新增</el-button
> >
<el-button <el-button
...@@ -30,9 +26,7 @@ ...@@ -30,9 +26,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="handleSearch" <el-button size="small" type="primary" @click="handleSearch">搜 索</el-button>
>搜 索</el-button
>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="handleReset">重 置</el-button> <el-button size="small" @click="handleReset">重 置</el-button>
...@@ -77,63 +71,57 @@ ...@@ -77,63 +71,57 @@
</template> </template>
<script> <script>
import TableHeader from "@/components/TableHeader.vue"; import TableHeader from '@/components/TableHeader.vue';
import AddAccess from "./components/AddAccess.vue"; import AddAccess from './components/AddAccess.vue';
import AccessSystem from "./components/AccessSystem.vue"; import AccessSystem from './components/AccessSystem.vue';
import { getAccessList, delAccess } from "@/api/system"; import { getAccessList, delAccess } from '@/api/system';
export default { export default {
components: { components: {
TableHeader, TableHeader,
AddAccess, AddAccess,
AccessSystem, AccessSystem
}, },
data() { data() {
return { return {
column: [ column: [
{ {
label: "全选", label: '全选',
type: "selection", type: 'selection',
width: "55", width: '55',
align: "center", align: 'center',
reserveSelection: true, reserveSelection: true
}, },
{ {
label: "序号", label: '序号',
type: "index", type: 'index',
width: "55", width: '55',
align: "center", align: 'center',
index: (index) => { index: (index) => {
return (this.page - 1) * this.size + index + 1; return (this.page - 1) * this.size + index + 1;
}, }
}, },
{ {
label: "区域名称", label: '区域名称',
prop: "areaName", prop: 'areaName',
align: "center", align: 'center'
}, },
{ {
label: "区域编码", label: '区域编码',
prop: "areaCode", prop: 'areaCode',
align: "center", align: 'center'
}, },
{ {
label: "背景图片", label: '背景图片',
prop: "bigPath", prop: 'bigPath',
align: "center", align: 'center',
formatter: (row) => { formatter: (row) => {
return ( return <el-image src={row.bigPath} previewSrcList={[row.bigPath]} class="h-[25px]" />;
<el-image }
src={row.bigPath}
previewSrcList={[row.bigPath]}
class="h-[25px]"
/>
);
},
}, },
{ {
label: "接入系统", label: '接入系统',
align: "center", align: 'center',
formatter: (row) => { formatter: (row) => {
if (row.accessSystemList && row.accessSystemList.length) { if (row.accessSystemList && row.accessSystemList.length) {
return ( return (
...@@ -144,16 +132,16 @@ export default { ...@@ -144,16 +132,16 @@ export default {
</div> </div>
); );
} }
}, }
}, },
{ {
label: "系统标签", label: '系统标签',
align: "center", align: 'center',
formatter: (row) => { formatter: (row) => {
if (row.tag) { if (row.tag) {
return ( return (
<div class="flex flex-wrap gap-2"> <div class="flex flex-wrap gap-2">
{row.tag.split(",").map((v) => { {row.tag.split(',').map((v) => {
return ( return (
<el-tag type="info" size="small"> <el-tag type="info" size="small">
{v} {v}
...@@ -163,59 +151,59 @@ export default { ...@@ -163,59 +151,59 @@ export default {
</div> </div>
); );
} }
}, }
}, },
{ {
label: "对接时间", label: '对接时间',
align: "center", align: 'center',
formatter: (row) => { formatter: (row) => {
if (row.accessTime) { if (row.accessTime) {
return this.$moment(row.accessTime).format("YYYY-MM-DD"); return this.$moment(row.accessTime).format('YYYY-MM-DD');
} }
}, }
}, },
{ {
label: "排序", label: '排序',
prop: "sort", prop: 'sort',
width: "100", width: '100',
align: "center", align: 'center'
}, },
{ {
label: "描述", label: '描述',
prop: "content", prop: 'content',
align: "center", align: 'center',
showOverflowTooltip: true, showOverflowTooltip: true
}, },
{ {
label: "备注", label: '备注',
prop: "remark", prop: 'remark',
align: "center", align: 'center',
showOverflowTooltip: true, showOverflowTooltip: true
}, },
{ {
label: "操作", label: '操作',
align: "center", align: 'center',
width: "180", width: '180',
formatter: (row) => { formatter: (row) => {
return ( return (
<div class="flex justify-center gap-4"> <div class="flex justify-center gap-4">
<span <span
v-hasPermi={["system:access:accessSystem"]} v-hasPermi={['system:access:accessSystem']}
class="primary cursor-pointer" class="primary cursor-pointer"
onClick={() => this.accessSystem(row)} onClick={() => this.accessSystem(row)}
> >
接入系统 接入系统
</span> </span>
<span <span
v-hasPermi={["system:access:edit"]} v-hasPermi={['system:access:edit']}
class="primary cursor-pointer" class="primary cursor-pointer"
onClick={() => this.handleEdit(row)} onClick={() => this.handleEdit(row)}
> >
编辑 编辑
</span> </span>
<span <span
v-hasPermi={["system:access:remove"]} v-hasPermi={['system:access:remove']}
class="delete cursor-pointer" class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)} onClick={() => this.handleDel(row.id)}
> >
...@@ -223,11 +211,11 @@ export default { ...@@ -223,11 +211,11 @@ export default {
</span> </span>
</div> </div>
); );
}, }
}, }
], ],
searchForm: { searchForm: {
areaName: "", areaName: ''
}, },
tableData: [], tableData: [],
page: 1, page: 1,
...@@ -236,11 +224,11 @@ export default { ...@@ -236,11 +224,11 @@ export default {
loading: false, loading: false,
selectRows: [], selectRows: [],
show: false, show: false,
title: "新增", title: '新增',
dict: {}, // 字典 dict: {}, // 字典
systemList: [], systemList: [],
accessShow: false, accessShow: false,
areaInfo: {}, areaInfo: {}
}; };
}, },
created() { created() {
...@@ -254,7 +242,7 @@ export default { ...@@ -254,7 +242,7 @@ export default {
let res = await getAccessList({ let res = await getAccessList({
page: this.page, page: this.page,
size: this.size, size: this.size,
areaName: `%${this.searchForm.areaName}%`, areaName: `%${this.searchForm.areaName}%`
}); });
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
...@@ -271,23 +259,23 @@ export default { ...@@ -271,23 +259,23 @@ export default {
// 批量移除 // 批量移除
handleDelAll() { handleDelAll() {
if (!this.selectRows.length) { if (!this.selectRows.length) {
this.$message.warning("请先勾选数据"); this.$message.warning('请先勾选数据');
return; return;
} }
let ids = this.selectRows.map((v) => v.id).join(","); let ids = this.selectRows.map((v) => v.id).join(',');
this.handleDel(ids); this.handleDel(ids);
}, },
// 搜索 // 搜索
handleSearch() { handleSearch() {
this.page = 1; this.page = 1;
this.$clearSelection("MyTable"); this.$clearSelection('MyTable');
this.getAccessList(); this.getAccessList();
}, },
// 重置 // 重置
handleReset() { handleReset() {
this.page = 1; this.page = 1;
this.$clearSelection("MyTable"); this.$clearSelection('MyTable');
this.$resetForm("searchForm"); this.$resetForm('searchForm');
this.getAccessList(); this.getAccessList();
}, },
// 选中 // 选中
...@@ -297,24 +285,24 @@ export default { ...@@ -297,24 +285,24 @@ export default {
// 新增 // 新增
handleAdd() { handleAdd() {
this.title = "新增"; this.title = '新增';
this.$refs.AddAccess.onAdd(); this.$refs.AddAccess.onAdd();
this.show = true; this.show = true;
}, },
// 编辑 // 编辑
handleEdit(row) { handleEdit(row) {
this.title = "编辑"; this.title = '编辑';
let data = this.$cloneDeep(row); let data = this.$cloneDeep(row);
this.$refs.AddAccess.onEdit(data); this.$refs.AddAccess.onEdit(data);
this.show = true; this.show = true;
}, },
// 移除 // 移除
handleDel(id) { handleDel(id) {
this.$confirm("此操作将删除所选数据,是否继续?", "系统提示", { this.$confirm('此操作将删除所选数据,是否继续?', '系统提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
cancelButtonClass: "btn-custom-cancel", cancelButtonClass: 'btn-custom-cancel',
type: "warning", type: 'warning'
}) })
.then(async () => { .then(async () => {
let res = await delAccess({ id }); let res = await delAccess({ id });
...@@ -322,19 +310,19 @@ export default { ...@@ -322,19 +310,19 @@ export default {
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.getAccessList(); this.getAccessList();
this.$clearSelection("MyTable"); this.$clearSelection('MyTable');
} }
}) })
.catch(() => { .catch(() => {
console.log("取消成功!"); console.log('取消成功!');
}); });
}, },
accessSystem(row) { accessSystem(row) {
let data = this.$cloneDeep(row); let data = this.$cloneDeep(row);
this.$refs.AccessSystem.onAdd(data); this.$refs.AccessSystem.onAdd(data);
this.accessShow = true; this.accessShow = true;
}, }
}, }
}; };
</script> </script>
......
...@@ -8,32 +8,18 @@ ...@@ -8,32 +8,18 @@
<div class="main w-full"> <div class="main w-full">
<el-button size="small" type="primary" @click="addSystem">添加</el-button> <el-button size="small" type="primary" @click="addSystem">添加</el-button>
<el-table :data="accessSystemList" style="width: 100%"> <el-table :data="accessSystemList" style="width: 100%">
<el-table-column type="index" :index="1" label="序号" align="center"> <el-table-column type="index" :index="1" label="序号" align="center"> </el-table-column>
</el-table-column>
<el-table-column prop="systemName" align="center" label="系统名称"> <el-table-column prop="systemName" align="center" label="系统名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input size="small" placeholder="请输入" v-model="scope.row.systemName"></el-input>
size="small"
placeholder="请输入"
v-model="scope.row.systemName"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="systemCode" align="center" label="系统编码"> <el-table-column prop="systemCode" align="center" label="系统编码">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input size="small" placeholder="请输入" v-model="scope.row.systemCode"></el-input>
size="small"
placeholder="请输入"
v-model="scope.row.systemCode"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="accessTime" align="center" label="接入日期" width="220">
prop="accessTime"
align="center"
label="接入日期"
width="220"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker <el-date-picker
style="width: 150px" style="width: 150px"
...@@ -46,18 +32,9 @@ ...@@ -46,18 +32,9 @@
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column width="80" align="center" prop="enabled" label="启\停用">
width="80"
align="center"
prop="enabled"
label="启\停用"
>
<template slot-scope="scope"> <template slot-scope="scope">
<YSwitch <YSwitch active-text="启用" inactive-text="停用" v-model="scope.row.enabled"></YSwitch>
active-text="启用"
inactive-text="停用"
v-model="scope.row.enabled"
></YSwitch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" width="60" prop="enabled" label="删除"> <el-table-column align="center" width="60" prop="enabled" label="删除">
...@@ -73,42 +50,36 @@ ...@@ -73,42 +50,36 @@
<div class="footer"> <div class="footer">
<el-button size="small" @click="handleClose">取 消</el-button> <el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" @click="handleReset">重 置</el-button> <el-button size="small" @click="handleReset">重 置</el-button>
<el-button <el-button size="small" type="primary" :loading="loading" @click="handleOk">确 定</el-button>
size="small"
type="primary"
:loading="loading"
@click="handleOk"
>确 定</el-button
>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import { saveAccess, deleteSystem } from "@/api/system"; import { saveAccess, deleteSystem } from '@/api/system';
export default { export default {
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
systemList: { systemList: {
required: true, required: true,
type: Array, type: Array,
default: () => [], default: () => []
}, }
}, },
data() { data() {
return { return {
loading: false, loading: false,
form: { form: {
systemName: "", systemName: '',
systemCode: "", systemCode: '',
accessTime: "", accessTime: '',
enabled: 1, enabled: 1
}, },
accessSystemList: [], accessSystemList: [],
areaInfo: {}, areaInfo: {}
}; };
}, },
computed: { computed: {
...@@ -117,9 +88,9 @@ export default { ...@@ -117,9 +88,9 @@ export default {
return this.show; return this.show;
}, },
set(val) { set(val) {
this.$emit("update:show", val); this.$emit('update:show', val);
}, }
}, }
}, },
methods: { methods: {
...@@ -128,11 +99,11 @@ export default { ...@@ -128,11 +99,11 @@ export default {
this.accessSystemList.push(row); this.accessSystemList.push(row);
}, },
handleClose() { handleClose() {
this.$resetForm("form"); this.$resetForm('form');
this.drawer = false; this.drawer = false;
}, },
handleReset() { handleReset() {
this.$resetForm("form"); this.$resetForm('form');
this.drawer = false; this.drawer = false;
}, },
...@@ -150,7 +121,7 @@ export default { ...@@ -150,7 +121,7 @@ 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);
this.$emit("success"); this.$emit('success');
this.handleClose(); this.handleClose();
} }
this.loading = false; this.loading = false;
...@@ -163,8 +134,8 @@ export default { ...@@ -163,8 +134,8 @@ export default {
} }
} }
this.accessSystemList.splice($index, 1); this.accessSystemList.splice($index, 1);
}, }
}, }
}; };
</script> </script>
......
...@@ -9,19 +9,9 @@ ...@@ -9,19 +9,9 @@
:close-on-click-modal="false" :close-on-click-modal="false"
top="10vh" top="10vh"
> >
<el-form <el-form ref="form" :model="form" :rules="rules" size="medium" label-width="100px">
ref="form"
:model="form"
:rules="rules"
size="medium"
label-width="100px"
>
<el-form-item label="区域" prop="areaName"> <el-form-item label="区域" prop="areaName">
<InputTree <InputTree :treeData="initTree" v-model="form.areaName" @change="changeArea"></InputTree>
:treeData="initTree"
v-model="form.areaName"
@change="changeArea"
></InputTree>
</el-form-item> </el-form-item>
<el-form-item label="系统标签" prop="tag"> <el-form-item label="系统标签" prop="tag">
<div class="flex gap-2"> <div class="flex gap-2">
...@@ -65,11 +55,7 @@ ...@@ -65,11 +55,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input-number <el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
v-model="form.sort"
controls-position="right"
:min="0"
></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="content"> <el-form-item label="描述" prop="content">
<el-input <el-input
...@@ -93,11 +79,7 @@ ...@@ -93,11 +79,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="medium" @click="handleRest">重 置</el-button> <el-button size="medium" @click="handleRest">重 置</el-button>
<el-button <el-button size="medium" type="primary" :loading="loading" @click="handleOk"
size="medium"
type="primary"
:loading="loading"
@click="handleOk"
>确 定</el-button >确 定</el-button
> >
</span> </span>
...@@ -106,74 +88,70 @@ ...@@ -106,74 +88,70 @@
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapState } from 'vuex';
import { saveAccess } from "@/api/system"; import { saveAccess } from '@/api/system';
import InputTree from "./InputTree.vue"; import InputTree from './InputTree.vue';
export default { export default {
components: { components: {
InputTree, InputTree
}, },
props: { props: {
title: { title: {
type: String, type: String,
required: true, required: true,
default: "", default: ''
}, },
show: { show: {
type: Boolean, type: Boolean,
required: true, required: true,
default: false, default: false
}, }
}, },
data() { data() {
return { return {
api: process.env.VUE_APP_API_BASE_URL, api: process.env.VUE_APP_API_BASE_URL,
loading: false, loading: false,
inputVisible: false, inputVisible: false,
inputValue: "", inputValue: '',
bigPathList: [], bigPathList: [],
form: { form: {
areaName: "", areaName: '',
areaCode: "", areaCode: '',
areaId: "", areaId: '',
siteId: "", siteId: '',
siteCode: "", siteCode: '',
siteName: "", siteName: '',
latitude: "", latitude: '',
longitude: "", longitude: '',
type: "", type: '',
bigPath: "", bigPath: '',
tag: [], tag: [],
sort: 99, sort: 99,
remark: "", remark: '',
icon: "", icon: '',
accessTime: "", // 接入时间 accessTime: '', // 接入时间
content: "", // 内容 content: '', // 内容
accessSystemList: [], accessSystemList: []
}, },
rules: { rules: {
areaName: [ areaName: [{ required: true, message: '请选择区域', trigger: 'change' }],
{ required: true, message: "请选择区域", trigger: "change" }, bigPath: [{ required: true, message: '请上传背景图片', trigger: 'change' }]
], }
bigPath: [
{ required: true, message: "请上传背景图片", trigger: "change" },
],
},
}; };
}, },
computed: { computed: {
...mapState("user", ["areaTree"]), ...mapState('user', ['areaTree']),
Visible: { Visible: {
get() { get() {
return this.show; return this.show;
}, },
set(val) { set(val) {
this.$emit("update:show", val); this.$emit('update:show', val);
}, }
}, },
initTree() { initTree() {
return this.addAreaNameField(this.areaTree); return this.addAreaNameField(this.areaTree);
}, }
}, },
methods: { methods: {
// 确定 // 确定
...@@ -183,12 +161,12 @@ export default { ...@@ -183,12 +161,12 @@ export default {
this.loading = true; this.loading = true;
let res = await saveAccess({ let res = await saveAccess({
...this.form, ...this.form,
tag: this.form.tag.join(","), tag: this.form.tag.join(',')
}); });
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.$emit("success"); this.$emit('success');
this.handleClose(); this.handleClose();
} }
this.loading = false; this.loading = false;
...@@ -198,14 +176,14 @@ export default { ...@@ -198,14 +176,14 @@ export default {
// 新增 // 新增
onAdd() { onAdd() {
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id"); this.form.id && this.$delete(this.form, 'id');
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
setTimeout(() => { setTimeout(() => {
this.form = row; this.form = row;
if (this.form.tag) { if (this.form.tag) {
this.form.tag = this.form.tag.split(","); this.form.tag = this.form.tag.split(',');
} else { } else {
this.form.tag = []; this.form.tag = [];
} }
...@@ -213,8 +191,8 @@ export default { ...@@ -213,8 +191,8 @@ export default {
this.bigPathList = [ this.bigPathList = [
{ {
name: this.form.bigPath, name: this.form.bigPath,
url: this.form.bigPath, url: this.form.bigPath
}, }
]; ];
} }
}, 10); }, 10);
...@@ -222,33 +200,24 @@ export default { ...@@ -222,33 +200,24 @@ export default {
// 重置 // 重置
handleRest() { handleRest() {
this.bigPathList = []; this.bigPathList = [];
this.$resetForm("form"); this.$resetForm('form');
}, },
// 关闭 // 关闭
handleClose() { handleClose() {
this.bigPathList = []; this.bigPathList = [];
this.$resetForm("form"); this.$resetForm('form');
this.Visible = false; this.Visible = false;
}, },
changeArea(row) { changeArea(row) {
let { let { areaName, areaCode, id, label, siteCode, latitude, longitude, type } = row;
areaName,
areaCode,
id,
label,
siteCode,
latitude,
longitude,
type,
} = row;
this.form.areaId = ""; this.form.areaId = '';
this.form.siteId = ""; this.form.siteId = '';
this.form.siteName = ""; this.form.siteName = '';
if (type === "area") { if (type === 'area') {
this.form.areaId = id; this.form.areaId = id;
} else if (type === "site") { } else if (type === 'site') {
this.form.siteId = id; this.form.siteId = id;
this.form.siteName = label; this.form.siteName = label;
} }
...@@ -280,7 +249,7 @@ export default { ...@@ -280,7 +249,7 @@ export default {
showInput() { showInput() {
if (this.form.tag.length >= 2) { if (this.form.tag.length >= 2) {
this.$message.warning("暂时只能添加两个系统标签"); this.$message.warning('暂时只能添加两个系统标签');
return; return;
} }
this.inputVisible = true; this.inputVisible = true;
...@@ -293,15 +262,15 @@ export default { ...@@ -293,15 +262,15 @@ export default {
let inputValue = this.inputValue; let inputValue = this.inputValue;
if (inputValue) { if (inputValue) {
if (this.form.tag.includes(inputValue)) { if (this.form.tag.includes(inputValue)) {
this.$message.warning("已存在相同标签"); this.$message.warning('已存在相同标签');
return; return;
} }
this.form.tag.push(inputValue); this.form.tag.push(inputValue);
} }
this.inputVisible = false; this.inputVisible = false;
this.inputValue = ""; this.inputValue = '';
}, }
}, }
}; };
</script> </script>
......
...@@ -23,41 +23,41 @@ ...@@ -23,41 +23,41 @@
<script> <script>
export default { export default {
name: "InputTree", name: 'InputTree',
props: { props: {
treeData: { treeData: {
type: Array, type: Array,
default: () => { default: () => {
return []; return [];
}, }
}, },
value: { value: {
default: "", default: ''
}, },
defaultProps: { defaultProps: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
children: "children", children: 'children',
label: "areaName", label: 'areaName'
}; };
}, }
}, }
}, },
data() { data() {
return {}; return {};
}, },
methods: { methods: {
handleClear() { handleClear() {
this.$emit("input", ""); this.$emit('input', '');
this.$emit("change", {}); this.$emit('change', {});
this.$refs.tree.setCurrentKey(null); this.$refs.tree.setCurrentKey(null);
}, },
handleNodeClick(row) { handleNodeClick(row) {
this.$emit("input", row.areaName); this.$emit('input', row.areaName);
this.$emit("change", row); this.$emit('change', row);
}, }
}, }
}; };
</script> </script>
......
...@@ -2,12 +2,8 @@ ...@@ -2,12 +2,8 @@
<div class="h-full w-full"> <div class="h-full w-full">
<TableHeader> <TableHeader>
<div slot="left"> <div slot="left">
<el-button size="small" type="primary" @click="handleAdd" <el-button size="small" type="primary" @click="handleAdd">新增</el-button>
>新增</el-button <el-button size="small" type="danger" @click="handleDelAll">批量删除</el-button>
>
<el-button size="small" type="danger" @click="handleDelAll"
>批量删除</el-button
>
</div> </div>
<div slot="right"> <div slot="right">
<el-form ref="searchForm" :model="searchForm" inline> <el-form ref="searchForm" :model="searchForm" inline>
...@@ -22,9 +18,7 @@ ...@@ -22,9 +18,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="handleSearch" <el-button size="small" type="primary" @click="handleSearch">搜 索</el-button>
>搜 索</el-button
>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="handleReset">重 置</el-button> <el-button size="small" @click="handleReset">重 置</el-button>
...@@ -63,89 +57,83 @@ ...@@ -63,89 +57,83 @@
</template> </template>
<script> <script>
import TableHeader from "@/components/TableHeader.vue"; import TableHeader from '@/components/TableHeader.vue';
import { getSystemList, deleteSystem } from "@/api/system"; import { getSystemList, deleteSystem } from '@/api/system';
import AddAreaSystem from "./components/AddAreaSystem.vue"; import AddAreaSystem from './components/AddAreaSystem.vue';
export default { export default {
components: { components: {
TableHeader, TableHeader,
AddAreaSystem, AddAreaSystem
}, },
data() { data() {
return { return {
column: [ column: [
{ {
label: "全选", label: '全选',
type: "selection", type: 'selection',
width: "55", width: '55',
align: "center", align: 'center',
reserveSelection: true, reserveSelection: true
}, },
{ {
label: "序号", label: '序号',
type: "index", type: 'index',
width: "55", width: '55',
align: "center", align: 'center',
index: (index) => { index: (index) => {
return (this.page - 1) * this.size + index + 1; return (this.page - 1) * this.size + index + 1;
}, }
}, },
{ {
label: "系统名称", label: '系统名称',
prop: "systemName", prop: 'systemName',
align: "center", align: 'center'
}, },
{ {
label: "系统编码", label: '系统编码',
prop: "systemCode", prop: 'systemCode',
align: "center", align: 'center'
}, },
{ {
label: "创建时间", label: '创建时间',
align: "center", align: 'center',
formatter: (row) => { formatter: (row) => {
if (row.createTime) { if (row.createTime) {
return this.$moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"); return this.$moment(row.createTime).format('YYYY-MM-DD HH:mm:ss');
} }
}, }
}, },
{ {
label: "排序", label: '排序',
prop: "sort", prop: 'sort',
align: "center", align: 'center'
}, },
{ {
label: "备注", label: '备注',
prop: "remark", prop: 'remark',
align: "center", align: 'center'
}, },
{ {
label: "操作", label: '操作',
align: "center", align: 'center',
width: "120", width: '120',
formatter: (row) => { formatter: (row) => {
return ( return (
<div class="flex justify-center gap-4"> <div class="flex justify-center gap-4">
<span <span class="primary cursor-pointer" onClick={() => this.handleEdit(row)}>
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑 编辑
</span> </span>
<span <span class="delete cursor-pointer" onClick={() => this.handleDel(row.id)}>
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
删除 删除
</span> </span>
</div> </div>
); );
}, }
}, }
], ],
searchForm: { searchForm: {
systemName: "", systemName: ''
}, },
tableData: [], tableData: [],
page: 1, page: 1,
...@@ -154,8 +142,8 @@ export default { ...@@ -154,8 +142,8 @@ export default {
loading: false, loading: false,
selectRows: [], selectRows: [],
show: false, show: false,
title: "新增", title: '新增',
dict: {}, // 字典 dict: {} // 字典
}; };
}, },
created() { created() {
...@@ -169,7 +157,7 @@ export default { ...@@ -169,7 +157,7 @@ export default {
let res = await getSystemList({ let res = await getSystemList({
page: this.page, page: this.page,
size: this.size, size: this.size,
systemName: `%${this.searchForm.systemName}%`, systemName: `%${this.searchForm.systemName}%`
}); });
this.loading = false; this.loading = false;
if (res.data.code == 1) { if (res.data.code == 1) {
...@@ -186,23 +174,23 @@ export default { ...@@ -186,23 +174,23 @@ export default {
// 批量移除 // 批量移除
handleDelAll() { handleDelAll() {
if (!this.selectRows.length) { if (!this.selectRows.length) {
this.$message.warning("请先勾选数据"); this.$message.warning('请先勾选数据');
return; return;
} }
let ids = this.selectRows.map((v) => v.id).join(","); let ids = this.selectRows.map((v) => v.id).join(',');
this.handleDel(ids); this.handleDel(ids);
}, },
// 搜索 // 搜索
handleSearch() { handleSearch() {
this.page = 1; this.page = 1;
this.$clearSelection("MyTable"); this.$clearSelection('MyTable');
this.getSystemList(); this.getSystemList();
}, },
// 重置 // 重置
handleReset() { handleReset() {
this.page = 1; this.page = 1;
this.$clearSelection("MyTable"); this.$clearSelection('MyTable');
this.$resetForm("searchForm"); this.$resetForm('searchForm');
this.getSystemList(); this.getSystemList();
}, },
// 选中 // 选中
...@@ -212,24 +200,24 @@ export default { ...@@ -212,24 +200,24 @@ export default {
// 新增 // 新增
handleAdd() { handleAdd() {
this.title = "新增"; this.title = '新增';
this.$refs.AddAreaSystem.onAdd(); this.$refs.AddAreaSystem.onAdd();
this.show = true; this.show = true;
}, },
// 编辑 // 编辑
handleEdit(row) { handleEdit(row) {
this.title = "编辑"; this.title = '编辑';
let data = this.$cloneDeep(row); let data = this.$cloneDeep(row);
this.$refs.AddAreaSystem.onEdit(data); this.$refs.AddAreaSystem.onEdit(data);
this.show = true; this.show = true;
}, },
// 移除 // 移除
handleDel(id) { handleDel(id) {
this.$confirm("此操作将删除所选数据,是否继续?", "系统提示", { this.$confirm('此操作将删除所选数据,是否继续?', '系统提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
cancelButtonClass: "btn-custom-cancel", cancelButtonClass: 'btn-custom-cancel',
type: "warning", type: 'warning'
}) })
.then(async () => { .then(async () => {
let res = await deleteSystem({ id }); let res = await deleteSystem({ id });
...@@ -237,14 +225,14 @@ export default { ...@@ -237,14 +225,14 @@ export default {
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.getSystemList(); this.getSystemList();
this.$clearSelection("MyTable"); this.$clearSelection('MyTable');
} }
}) })
.catch(() => { .catch(() => {
console.log("取消成功!"); console.log('取消成功!');
}); });
}, }
}, }
}; };
</script> </script>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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