main
bibi 3 years ago
parent 7a8fbb2b5a
commit da5102d6e6

@ -14,6 +14,7 @@
"less-loader": "5.0.0",
"momen": "^0.0.1-security",
"nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2",
"vue": "^2.6.11",
"vue-router": "^3.5.3",
"vuex": "^3.6.2"

@ -2,44 +2,51 @@ import httpService from "@/request"
// 路线
export function routerList(params) {
export function routeList(params) {
return httpService({
url: `/user/inspectionRouter/list`,
url: `/user/inspectionRoute/list`,
method: 'get',
params: params,
})
}
export function routerisEnable(params) {
export function routeisEnable(params) {
return httpService({
url: `/user/inspectionRouter/isEnable`,
url: `/user/inspectionRoute/isEnable`,
method: 'get',
params: params,
})
}
export function routerInfo(params) {
export function pointSelect(params) {
return httpService({
url: `/user/inspectionRouter/findById`,
url: `/user/inspectionPoint/allList`,
method: 'get',
params: params,
})
}
export function routerInsert(params) {
export function routeInfo(params) {
return httpService({
url: `/user/inspectionRouter/insert`,
url: `/user/inspectionRoute/findById`,
method: 'get',
params: params,
})
}
export function routeInsert(params) {
return httpService({
url: `/user/inspectionRoute/insert`,
method: 'post',
data: params,
})
}
export function routerDel(params) {
export function routeDel(params) {
return httpService({
url: `/user/inspectionRouter/delete`,
url: `/user/inspectionRoute/delete`,
method: 'post',
data: params,
})
}
export function routerUpdate(params) {
export function routeUpdate(params) {
return httpService({
url: `/user/inspectionRouter/update`,
url: `/user/inspectionRoute/update`,
method: 'post',
data: params,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

@ -50,6 +50,14 @@ export default [
component: resolve => require(['@/views/Operation/InspectionManage/_inspectionPlan'], resolve),
meta: {title: '巡检计划'},
},
{
path: '/InspectionManage/InspectionExecute',
name: "InspectionExecute",
title: "巡检记录",
hide: false,
component: resolve => require(['@/views/Operation/InspectionManage/_inspectionExecute/index.vue'], resolve),
meta: {title: '巡检记录'},
},
]
},
{

@ -0,0 +1,80 @@
export const formItem = [
{
type: 'select',
label:'资讯分类',
prop:'categoryId',
option:[],
placeholder:'请选择'
},
{
type: 'select',
label:'发布状态',
prop:'status',
option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
},
{
type: 'time',
label:'创建时间',
start: 'createStartDate',
end:'createEndDate',
},
{
type: 'input',
label:'标题',
prop:'title',
placeholder:'请输入'
},
]
export const columns = [
{
title: "标题",
dataIndex: "title",
width: "10%",
},
{
title: "分类",
dataIndex: "categoryName",
width: "10%",
},
{
title: "发布状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
return '未发布'
case 2:
return '已发布'
}
}
},
{
title: "阅读量",
dataIndex: "viewsNum",
width: "10%",
},
{
title: "创建时间",
dataIndex: "createDate",
width: "12%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,21 @@
export const form = {
id:undefined,
title:undefined,
categoryId:undefined,
status:undefined,
content:undefined,
imgUrls:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
status:[{required:true,message:'请选择',trigger:'change'}],
content:[{required:true,message:'请输入',trigger:'blur'}],
}
export const options = {
status:[
{ id:1, name:'未发布' },
{ id:2, name:'已发布' },
],
categoryId:[]
}

@ -0,0 +1,201 @@
<template>
<div>
<a-drawer
:title="title"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="title" label="标题">
<a-input
v-model="form.title"
placeholder="请输入标题"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="categoryId" label="资讯分类">
<a-select
v-model="form.categoryId"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.categoryId"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="status" label="发布状态">
<a-select
v-model="form.status"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item prop="content" label="内容">
<a-textarea
v-model="form.content"
placeholder="请输入内容"
style="width: 80%"
></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
资讯封面图片
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="submit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { form, rules, options } from "./form.js";
import {
newsInsert,
newsUpdate,
newsInfo,
itemSelect
} from "@/api/operation/news/index.js";
export default {
props: {
show: {
type: Boolean,
default: false,
},
editId: Number,
},
data() {
return {
title: "新增资讯",
form,
rules,
options,
fileList: [],
};
},
mounted() {
this.getItem();
},
methods: {
async getItem() {
let res = await itemSelect();
this.options.categoryId = res.data;
},
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = [];
this.form.imgUrls = [];
this.$emit("addClose");
},
success() {
this.$emit("success");
this.addClose();
},
submit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await newsInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
} else {
console.log(this.form);
let res = await newsUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
}
}
});
},
handleChange(data) {
this.fileList = data;
if (data[0].status === "done") {
console.log("-------done-------");
this.form.imgUrls.push(data[0].response.data);
}
},
},
watch: {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改资讯";
this.form.id = val;
newsInfo({ informationId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
const pic = [];
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
}
this.fileList = pic;
} else {
this.form.imgUrls = [];
}
});
} else {
this.title = "新增资讯";
}
},
immediate: true,
},
},
};
</script>
<style></style>

@ -0,0 +1,190 @@
<template>
<div>
<div class="cardTitle">资讯管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增资讯</a-button
>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2600 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="detail(row.id)"></a>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
</a-table>
<div class="action">
<a-dropdown :disabled="!hasSelected">
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="del"> 批量删除 </a-menu-item>
</a-menu>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<addForm
:show="drawer.show"
@success="success"
@addClose="addClose"
:editId="editId"
></addForm>
<detailForm :detailId="detailId" :show="drawer.detail" @detailClose="detailClose"></detailForm>
</div>
</template>
<script>
import { newsList, newsDel,itemSelect } from "@/api/operation/news/index.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue";
export default {
components: {
addForm,
detailForm
},
data() {
return {
drawer: {
show: false,
detail:false
},
editId: null,
detailId:null,
tableData: [],
searchForm: {
activityAddress: undefined,
organizerName: undefined,
activityContact: undefined,
activityTel: undefined,
title: undefined,
status: undefined,
registrationStartTime: undefined,
registrationEndTime: undefined,
activityStartTime: undefined,
activityEndTime: undefined,
},
formItem,
columns,
pagination,
// index
selectedRowKeys: [],
};
},
mounted() {
this.getData();
this.getItem();
},
methods: {
async getData(data) {
if (data !== undefined) {
console.log(data);
this.searchForm = data;
console.log(this.searchForm);
}
let res = await newsList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
},
changeTime(data,start,end){
console.log(start);
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
console.log(this.searchForm);
},
edit(id) {
this.editId = id;
this.drawer.show = true;
},
del(ids) {
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await newsDel({ informationIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
handleMenuClick(data) {
console.log(data);
if (data.key === "del") {
this.del(this.selectedRowKeys);
}
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
addClose() {
this.drawer.show = false;
this.editId = null;
},
success() {
this.getData();
},
detail(id){
this.drawer.detail = true;
this.detailId = id;
},
detailClose(){
this.detailId = null;
this.drawer.detail = false;
}
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
.table-img {
width: 40px;
height: 40px;
}
</style>

@ -1,66 +1,47 @@
export const formItem = [
{
type: 'select',
label:'资讯分类',
prop:'categoryId',
option:[],
placeholder:'请选择'
},
{
type: 'select',
label:'发布状态',
prop:'status',
option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
},
{
type: 'time',
label:'创建时间',
start: 'createStartDate',
end:'createEndDate',
type: 'input',
label:'编号',
prop:'code',
placeholder:'请输入'
},
{
type: 'input',
label:'标题',
prop:'title',
label:'名称',
prop:'name',
placeholder:'请输入'
},
]
export const columns = [
{
title: "标题",
dataIndex: "title",
width: "10%",
title: "路线编号",
dataIndex: "code",
},
{
title: "路线名称",
dataIndex: "name",
},
{
title: "持续时间",
dataIndex: "spaceTime",
},
{
title: "分类",
dataIndex: "categoryName",
width: "10%",
title: "创建时间",
dataIndex: "createDate",
},
{
title: "发布状态",
title: "状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
return '未发布'
return '启用'
case 2:
return '已发布'
return '停用'
}
}
},
{
title: "阅读量",
dataIndex: "viewsNum",
width: "10%",
},
{
title: "创建时间",
dataIndex: "createDate",
width: "12%",
},
{
title: "操作",
dataIndex: "action",

@ -1,21 +1,21 @@
export const form = {
id:undefined,
title:undefined,
categoryId:undefined,
name:undefined,
describes:undefined,
status:undefined,
content:undefined,
imgUrls:[]
spaceTime:undefined,
pointRouteList:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
name:[{required:true,message:'请输入路线名称',trigger:'blur'}],
describes:[{required:true,message:'请输入描述',trigger:'blur'}],
status:[{required:true,message:'请选择',trigger:'change'}],
content:[{required:true,message:'请输入',trigger:'blur'}],
spaceTime:[{required:true,message:'请输入持续时间',trigger:'blur'}],
}
export const options = {
status:[
{ id:1, name:'未发布' },
{ id:2, name:'已发布' },
{ id:1, name:'启用' },
{ id:2, name:'停用' },
],
categoryId:[]
pointList:[]
}

@ -16,65 +16,25 @@
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="title" label="标题">
<a-input
v-model="form.title"
placeholder="请输入标题"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="categoryId" label="资讯分类">
<a-select
v-model="form.categoryId"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.categoryId"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="status" label="发布状态">
<a-select
v-model="form.status"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item prop="content" label="内容">
<a-textarea
v-model="form.content"
placeholder="请输入内容"
style="width: 80%"
></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
资讯封面图片
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
</a-row>
<a-form-model-item prop='name' label='路线名称'>
<a-input v-model="form.name" placeholder="请输入" style="width:60%"></a-input>
</a-form-model-item>
<a-form-model-item prop='describes' label='描述'>
<a-input v-model="form.describes" placeholder="请输入" style="width:60%"></a-input>
</a-form-model-item>
<a-form-model-item prop='status' label='状态' v-if="title==='新增巡检路线'">
<a-select v-model="form.status" placeholder="请输入" style="width:60%">
<a-select-option v-for="item in options.status" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item prop='spaceTime' label='持续时间'>
<a-input-number v-model="form.spaceTime" placeholder="请输入" style="width:60%"></a-input-number>
</a-form-model-item>
<a-form-model-item prop='pointRouteList' label='巡检路线'>
<a-select mode="multiple" v-model="selectPoint" placeholder="请选择" style="width:60%">
<a-select-option v-for="item in options.pointList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</div>
<div class="drawer-footer">
@ -90,11 +50,11 @@
<script>
import { form, rules, options } from "./form.js";
import {
newsInsert,
newsUpdate,
newsInfo,
itemSelect
} from "@/api/operation/news/index.js";
routeInsert,
routeUpdate,
routeInfo,
pointSelect
} from "@/api/operation/inspection/route.js";
export default {
props: {
show: {
@ -105,25 +65,25 @@ export default {
},
data() {
return {
title: "新增资讯",
title: "新增巡检路线",
form,
rules,
options,
fileList: [],
selectPoint:[]
};
},
mounted() {
this.getItem();
this.getPoint();
},
methods: {
async getItem() {
let res = await itemSelect();
this.options.categoryId = res.data;
async getPoint() {
let res = await pointSelect();
this.options.pointList = res.data;
},
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = [];
this.form.imgUrls = [];
this.form.pointRouteList = [];
this.selectPoint = []
this.$emit("addClose");
},
success() {
@ -131,10 +91,14 @@ export default {
this.addClose();
},
submit() {
this.form.pointRouteList = []
for(let k in this.selectPoint){
this.form.pointRouteList.push({inspectionPointId:this.selectPoint[k]});
}
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await newsInsert(this.form);
let res = await routeInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -143,7 +107,7 @@ export default {
}
} else {
console.log(this.form);
let res = await newsUpdate(this.form);
let res = await routeUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -154,42 +118,24 @@ export default {
}
});
},
handleChange(data) {
this.fileList = data;
if (data[0].status === "done") {
console.log("-------done-------");
this.form.imgUrls.push(data[0].response.data);
}
},
},
watch: {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改资讯";
this.title = "修改巡检路线";
this.selectPoint = []
this.form.id = val;
newsInfo({ informationId: val }).then((res) => {
routeInfo({ routeId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
const pic = [];
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
if(this.form.routePointList.length>0){
for(let item of this.form.routePointList){
this.selectPoint.push(item.id)
}
this.fileList = pic;
} else {
this.form.imgUrls = [];
}
});
} else {
this.title = "新增资讯";
this.title = "新增巡检路线";
}
},
immediate: true,

@ -1,15 +1,14 @@
<template>
<div>
<div class="cardTitle">资讯管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<div class="cardTitle">巡检路线</div>
<searchForm :formItem="formItem" @getSearch="getData($event)"></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增资讯</a-button
>新增路线</a-button
>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2600 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
@ -23,8 +22,9 @@
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="detail(row.id)"></a>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" v-if="row.status===2" @click="enable(row.id)"></a>
<a class="ant-dropdown-link" v-else-if="row.status===1" @click="enable(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
@ -48,40 +48,27 @@
@addClose="addClose"
:editId="editId"
></addForm>
<detailForm :detailId="detailId" :show="drawer.detail" @detailClose="detailClose"></detailForm>
</div>
</template>
<script>
import { newsList, newsDel,itemSelect } from "@/api/operation/news/index.js";
import { routeList, routeDel,routeisEnable } from "@/api/operation/inspection/route.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue";
export default {
components: {
addForm,
detailForm
},
data() {
return {
drawer: {
show: false,
detail:false
},
editId: null,
detailId:null,
tableData: [],
searchForm: {
activityAddress: undefined,
organizerName: undefined,
activityContact: undefined,
activityTel: undefined,
title: undefined,
status: undefined,
registrationStartTime: undefined,
registrationEndTime: undefined,
activityStartTime: undefined,
activityEndTime: undefined,
code: undefined,
name: undefined,
},
formItem,
columns,
@ -92,7 +79,6 @@ export default {
},
mounted() {
this.getData();
this.getItem();
},
methods: {
async getData(data) {
@ -101,24 +87,14 @@ export default {
this.searchForm = data;
console.log(this.searchForm);
}
let res = await newsList({
let res = await routeList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
},
changeTime(data,start,end){
console.log(start);
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
console.log(this.searchForm);
this.selectedRowKeys = []
},
edit(id) {
this.editId = id;
@ -132,7 +108,7 @@ export default {
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await newsDel({ informationIds: ids });
let res = await routeDel({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
@ -142,6 +118,15 @@ export default {
},
});
},
async enable(id) {
let res = await routeisEnable({ routeId: id });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
@ -166,14 +151,6 @@ export default {
success() {
this.getData();
},
detail(id){
this.drawer.detail = true;
this.detailId = id;
},
detailClose(){
this.detailId = null;
this.drawer.detail = false;
}
},
computed: {
hasSelected() {

@ -1,71 +1,43 @@
export const formItem = [
{
type: 'select',
label:'资讯分类',
prop:'categoryId',
option:[],
placeholder:'请选择'
},
{
type: 'select',
label:'发布状态',
prop:'status',
option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
},
{
type: 'time',
label:'创建时间',
start: 'createStartDate',
end:'createEndDate',
type: 'input',
label:'编号',
prop:'code',
placeholder:'请输入'
},
{
type: 'input',
label:'标题',
prop:'title',
label:'名称',
prop:'name',
placeholder:'请输入'
},
]
export const columns = [
{
title: "标题",
dataIndex: "title",
width: "10%",
title: "编号",
dataIndex: "code",
},
{
title: "分类",
dataIndex: "categoryName",
width: "10%",
title: "名称",
dataIndex: "name",
},
{
title: "发布状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
return '未发布'
case 2:
return '已发布'
}
title: "巡检模式",
dataIndex: "type",
customRender: function (type) {
return '扫码'
}
},
{
title: "阅读量",
dataIndex: "viewsNum",
width: "10%",
},
{
title: "创建时间",
dataIndex: "createDate",
width: "12%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
width: "280",
fixed: "right",
scopedSlots: { customRender: "action" },
},

@ -1,111 +0,0 @@
<template>
<div>
<a-drawer
title="资讯-详情"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="detailClose"
>
<div class="drawer-content">
<div class="content-title">
{{ detailData.title }}
<a-tag color="blue">{{
detailData.status === 1 ? "未发布" : "已发布"
}}</a-tag>
</div>
<a-divider></a-divider>
<a-descriptions>
<a-descriptions-item label="资讯类型">
{{ detailData.categoryName }}
</a-descriptions-item>
<a-descriptions-item label="阅读量">
{{ detailData.viewsNum }}
</a-descriptions-item>
<a-descriptions-item label="创建人">
{{ detailData.createName }}
</a-descriptions-item>
<a-descriptions-item label="创建时间">
{{ detailData.createDate }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="1">
<a-descriptions-item label="资讯内容">
{{ detailData.content }}
</a-descriptions-item>
<a-descriptions-item label="公告封面图">
<img
v-for="(item, index) in detailData.imgList"
:key="index"
:src="$ImgUrl(item.url)"
class="content-img"
/>
</a-descriptions-item>
</a-descriptions>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="detailClose">
关闭
</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { newsInfo } from "@/api/operation/news/index.js";
export default {
props: {
show: {
type: Boolean,
default: false,
},
detailId: Number,
},
data() {
return {
detailData: {},
};
},
mounted() {},
methods: {
detailClose() {
this.$emit("detailClose");
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
},
watch: {
detailId: {
handler(id) {
if (id !== null && id !== undefined) {
newsInfo({ informationId: id }).then((res) => {
this.detailData = res.data;
});
}
},
immediate: true,
},
},
};
</script>
<style lang="less" scoped>
.content-title {
color: #000000d9;
font-weight: 500;
font-size: 18px;
line-height: 25px;
}
.content-img {
width: 108px;
height: 86px;
}
</style>

@ -1,16 +1,14 @@
export const form = {
id:undefined,
title:undefined,
categoryId:undefined,
status:undefined,
content:undefined,
imgUrls:[]
name:undefined,
type:undefined,
longitude:undefined,
latitude:undefined,
itemsList:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
status:[{required:true,message:'请选择',trigger:'change'}],
content:[{required:true,message:'请输入',trigger:'blur'}],
name:[{required:true,message:'请输入名称',trigger:'blur'}],
type:[{required:true,message:'请选择分类',trigger:'change'}],
}
export const options = {
status:[

@ -16,65 +16,30 @@
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="title" label="标题">
<a-input
v-model="form.title"
placeholder="请输入标题"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="categoryId" label="资讯分类">
<a-select
v-model="form.categoryId"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.categoryId"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="status" label="发布状态">
<a-select
v-model="form.status"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item prop="content" label="内容">
<a-textarea
v-model="form.content"
placeholder="请输入内容"
style="width: 80%"
></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
资讯封面图片
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
</a-row>
<a-form-model-item label="名称" prop="name">
<a-input v-model="form.name" style="width: 60%" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="类型" prop="type">
<a-select v-model="form.type" style="width: 60%" placeholder="请选择">
<a-select-option :value="1">扫码</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="经度" prop="longitude">
<a-input v-model="form.longitude" style="width: 60%" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="纬度" prop="latitude">
<a-input v-model="form.latitude" style="width: 60%" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="检查项">
<a-select
style="width: 60%"
v-model="itemArray"
mode="tags"
:token-separators="[',']"
@change="handleChange"
>
</a-select>
</a-form-model-item>
</a-form-model>
</div>
<div class="drawer-footer">
@ -90,11 +55,10 @@
<script>
import { form, rules, options } from "./form.js";
import {
newsInsert,
newsUpdate,
newsInfo,
itemSelect
} from "@/api/operation/news/index.js";
pointInsert,
pointUpdate,
pointInfo,
} from "@/api/operation/inspection/point.js";
export default {
props: {
show: {
@ -105,25 +69,23 @@ export default {
},
data() {
return {
title: "新增资讯",
title: "新增巡检点",
form,
rules,
options,
fileList: [],
itemArray: [],
};
},
mounted() {
this.getItem();
},
methods: {
async getItem() {
let res = await itemSelect();
this.options.categoryId = res.data;
handleChange(value) {
console.log(`selected ${value}`);
},
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = [];
this.form.imgUrls = [];
this.form.itemsList = [];
this.itemArray=[]
this.$emit("addClose");
},
success() {
@ -131,10 +93,15 @@ export default {
this.addClose();
},
submit() {
this.form.itemsList = [];
for (let item in this.itemArray) {
console.log(this.itemArray[item]);
this.form.itemsList.push({ name: this.itemArray[item] });
}
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await newsInsert(this.form);
let res = await pointInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -143,7 +110,7 @@ export default {
}
} else {
console.log(this.form);
let res = await newsUpdate(this.form);
let res = await pointUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -154,42 +121,23 @@ export default {
}
});
},
handleChange(data) {
this.fileList = data;
if (data[0].status === "done") {
console.log("-------done-------");
this.form.imgUrls.push(data[0].response.data);
}
},
},
watch: {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改资讯";
this.itemArray = []
this.title = "修改巡检点";
this.form.id = val;
newsInfo({ informationId: val }).then((res) => {
pointInfo({ inspectionId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
const pic = [];
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
}
this.fileList = pic;
} else {
this.form.imgUrls = [];
for(let k of this.form.checkItemsList){
// console.log(k.name);
this.itemArray.push(k.name)
}
});
} else {
this.title = "新增资讯";
this.title = "新增巡检点";
}
},
immediate: true,

@ -1,7 +1,11 @@
<template>
<div>
<div class="cardTitle">巡检点</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<searchForm
:formItem="formItem"
@getSearch="getData($event)"
@changeTime="changeTime"
></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增巡更点</a-button
>
@ -9,7 +13,6 @@
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2600 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
@ -23,9 +26,11 @@
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="detail(row.id)"></a>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
<a class="ant-dropdown-link" @click="qrCodeGeneration(row.code)"
>巡检点二维码</a
>
</a-space>
</span>
</a-table>
@ -48,40 +53,41 @@
@addClose="addClose"
:editId="editId"
></addForm>
<detailForm :detailId="detailId" :show="drawer.detail" @detailClose="detailClose"></detailForm>
<a-modal title="巡检点二维码" :visible="qr.show" @cancel="qr.show=false" width='300px'>
<!-- 二维码图片 -->
<div id="qrCodeUrl"></div>
<!-- 取消按钮 -->
<span slot="footer" class="dialog-footer">
<a-button @click="qr.show=false"></a-button>
</span>
</a-modal>
</div>
</template>
<script>
import { newsList, newsDel,itemSelect } from "@/api/operation/news/index.js";
import QRCode from "qrcodejs2";
import { pointList, pointDel } from "@/api/operation/inspection/point.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue";
export default {
components: {
addForm,
detailForm
},
data() {
return {
drawer: {
show: false,
detail:false
detail: false,
},
qr: {
show: false,
},
editId: null,
detailId:null,
detailId: null,
tableData: [],
searchForm: {
activityAddress: undefined,
organizerName: undefined,
activityContact: undefined,
activityTel: undefined,
title: undefined,
status: undefined,
registrationStartTime: undefined,
registrationEndTime: undefined,
activityStartTime: undefined,
activityEndTime: undefined,
name: undefined,
code: undefined,
},
formItem,
columns,
@ -92,7 +98,6 @@ export default {
},
mounted() {
this.getData();
this.getItem();
},
methods: {
async getData(data) {
@ -101,23 +106,19 @@ export default {
this.searchForm = data;
console.log(this.searchForm);
}
let res = await newsList({
let res = await pointList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
...this.searchForm,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
this.selectedRowKeys = [];
},
changeTime(data,start,end){
changeTime(data, start, end) {
console.log(start);
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
this.searchForm[start] = data[0];
this.searchForm[end] = data[1];
console.log(this.searchForm);
},
edit(id) {
@ -132,7 +133,7 @@ export default {
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await newsDel({ informationIds: ids });
let res = await pointDel({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
@ -145,6 +146,22 @@ export default {
selectionChoosed(data) {
this.selectedRowKeys = data;
},
//
qrCodeGeneration(data) {
//
this.qr.show = true;
//
this.$nextTick(function () {
document.getElementById("qrCodeUrl").innerHTML = "";
let qrCodeUrl = new QRCode("qrCodeUrl", {
width: 200,
height: 200,
text: data,
colorDark: "#409EFF",
colorLight: "#fff",
});
});
},
handleMenuClick(data) {
console.log(data);
if (data.key === "del") {
@ -166,14 +183,6 @@ export default {
success() {
this.getData();
},
detail(id){
this.drawer.detail = true;
this.detailId = id;
},
detailClose(){
this.detailId = null;
this.drawer.detail = false;
}
},
computed: {
hasSelected() {
@ -187,4 +196,7 @@ export default {
width: 40px;
height: 40px;
}
/deep/ #qrCodeUrl > img {
margin: 0 auto;
}
</style>

@ -1,66 +1,47 @@
export const formItem = [
{
type: 'select',
label:'资讯分类',
prop:'categoryId',
option:[],
placeholder:'请选择'
},
{
type: 'select',
label:'发布状态',
prop:'status',
option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
},
{
type: 'time',
label:'创建时间',
start: 'createStartDate',
end:'createEndDate',
type: 'input',
label:'编号',
prop:'code',
placeholder:'请输入'
},
{
type: 'input',
label:'标题',
prop:'title',
label:'名称',
prop:'name',
placeholder:'请输入'
},
]
export const columns = [
{
title: "标题",
dataIndex: "title",
width: "10%",
title: "路线编号",
dataIndex: "code",
},
{
title: "路线名称",
dataIndex: "name",
},
{
title: "持续时间",
dataIndex: "spaceTime",
},
{
title: "分类",
dataIndex: "categoryName",
width: "10%",
title: "创建时间",
dataIndex: "createDate",
},
{
title: "发布状态",
title: "状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
return '未发布'
return '启用'
case 2:
return '已发布'
return '停用'
}
}
},
{
title: "阅读量",
dataIndex: "viewsNum",
width: "10%",
},
{
title: "创建时间",
dataIndex: "createDate",
width: "12%",
},
{
title: "操作",
dataIndex: "action",

@ -1,111 +0,0 @@
<template>
<div>
<a-drawer
title="资讯-详情"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="detailClose"
>
<div class="drawer-content">
<div class="content-title">
{{ detailData.title }}
<a-tag color="blue">{{
detailData.status === 1 ? "未发布" : "已发布"
}}</a-tag>
</div>
<a-divider></a-divider>
<a-descriptions>
<a-descriptions-item label="资讯类型">
{{ detailData.categoryName }}
</a-descriptions-item>
<a-descriptions-item label="阅读量">
{{ detailData.viewsNum }}
</a-descriptions-item>
<a-descriptions-item label="创建人">
{{ detailData.createName }}
</a-descriptions-item>
<a-descriptions-item label="创建时间">
{{ detailData.createDate }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="1">
<a-descriptions-item label="资讯内容">
{{ detailData.content }}
</a-descriptions-item>
<a-descriptions-item label="公告封面图">
<img
v-for="(item, index) in detailData.imgList"
:key="index"
:src="$ImgUrl(item.url)"
class="content-img"
/>
</a-descriptions-item>
</a-descriptions>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="detailClose">
关闭
</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { newsInfo } from "@/api/operation/news/index.js";
export default {
props: {
show: {
type: Boolean,
default: false,
},
detailId: Number,
},
data() {
return {
detailData: {},
};
},
mounted() {},
methods: {
detailClose() {
this.$emit("detailClose");
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
},
watch: {
detailId: {
handler(id) {
if (id !== null && id !== undefined) {
newsInfo({ informationId: id }).then((res) => {
this.detailData = res.data;
});
}
},
immediate: true,
},
},
};
</script>
<style lang="less" scoped>
.content-title {
color: #000000d9;
font-weight: 500;
font-size: 18px;
line-height: 25px;
}
.content-img {
width: 108px;
height: 86px;
}
</style>

@ -1,21 +1,21 @@
export const form = {
id:undefined,
title:undefined,
categoryId:undefined,
name:undefined,
describes:undefined,
status:undefined,
content:undefined,
imgUrls:[]
spaceTime:undefined,
pointRouteList:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
name:[{required:true,message:'请输入路线名称',trigger:'blur'}],
describes:[{required:true,message:'请输入描述',trigger:'blur'}],
status:[{required:true,message:'请选择',trigger:'change'}],
content:[{required:true,message:'请输入',trigger:'blur'}],
spaceTime:[{required:true,message:'请输入持续时间',trigger:'blur'}],
}
export const options = {
status:[
{ id:1, name:'未发布' },
{ id:2, name:'已发布' },
{ id:1, name:'启用' },
{ id:2, name:'停用' },
],
categoryId:[]
pointList:[]
}

@ -16,65 +16,25 @@
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="title" label="标题">
<a-input
v-model="form.title"
placeholder="请输入标题"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="categoryId" label="资讯分类">
<a-select
v-model="form.categoryId"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.categoryId"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="status" label="发布状态">
<a-select
v-model="form.status"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item prop="content" label="内容">
<a-textarea
v-model="form.content"
placeholder="请输入内容"
style="width: 80%"
></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
资讯封面图片
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
</a-row>
<a-form-model-item prop='name' label='路线名称'>
<a-input v-model="form.name" placeholder="请输入" style="width:60%"></a-input>
</a-form-model-item>
<a-form-model-item prop='describes' label='描述'>
<a-input v-model="form.describes" placeholder="请输入" style="width:60%"></a-input>
</a-form-model-item>
<a-form-model-item prop='status' label='状态' v-if="title==='新增巡检路线'">
<a-select v-model="form.status" placeholder="请输入" style="width:60%">
<a-select-option v-for="item in options.status" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item prop='spaceTime' label='持续时间'>
<a-input-number v-model="form.spaceTime" placeholder="请输入" style="width:60%"></a-input-number>
</a-form-model-item>
<a-form-model-item prop='pointRouteList' label='巡检路线'>
<a-select mode="multiple" v-model="selectPoint" placeholder="请选择" style="width:60%">
<a-select-option v-for="item in options.pointList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</div>
<div class="drawer-footer">
@ -90,11 +50,11 @@
<script>
import { form, rules, options } from "./form.js";
import {
newsInsert,
newsUpdate,
newsInfo,
itemSelect
} from "@/api/operation/news/index.js";
routeInsert,
routeUpdate,
routeInfo,
pointSelect
} from "@/api/operation/inspection/route.js";
export default {
props: {
show: {
@ -105,25 +65,25 @@ export default {
},
data() {
return {
title: "新增资讯",
title: "新增巡检路线",
form,
rules,
options,
fileList: [],
selectPoint:[]
};
},
mounted() {
this.getItem();
this.getPoint();
},
methods: {
async getItem() {
let res = await itemSelect();
this.options.categoryId = res.data;
async getPoint() {
let res = await pointSelect();
this.options.pointList = res.data;
},
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = [];
this.form.imgUrls = [];
this.form.pointRouteList = [];
this.selectPoint = []
this.$emit("addClose");
},
success() {
@ -131,10 +91,14 @@ export default {
this.addClose();
},
submit() {
this.form.pointRouteList = []
for(let k in this.selectPoint){
this.form.pointRouteList.push({inspectionPointId:this.selectPoint[k]});
}
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await newsInsert(this.form);
let res = await routeInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -143,7 +107,7 @@ export default {
}
} else {
console.log(this.form);
let res = await newsUpdate(this.form);
let res = await routeUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -154,42 +118,24 @@ export default {
}
});
},
handleChange(data) {
this.fileList = data;
if (data[0].status === "done") {
console.log("-------done-------");
this.form.imgUrls.push(data[0].response.data);
}
},
},
watch: {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改资讯";
this.title = "修改巡检路线";
this.selectPoint = []
this.form.id = val;
newsInfo({ informationId: val }).then((res) => {
routeInfo({ routeId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
const pic = [];
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
if(this.form.routePointList.length>0){
for(let item of this.form.routePointList){
this.selectPoint.push(item.id)
}
this.fileList = pic;
} else {
this.form.imgUrls = [];
}
});
} else {
this.title = "新增资讯";
this.title = "新增巡检路线";
}
},
immediate: true,

@ -1,15 +1,14 @@
<template>
<div>
<div class="cardTitle">资讯管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<div class="cardTitle">巡检路线</div>
<searchForm :formItem="formItem" @getSearch="getData($event)"></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增资讯</a-button
>新增路线</a-button
>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2600 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
@ -23,8 +22,9 @@
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="detail(row.id)"></a>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" v-if="row.status===2" @click="enable(row.id)"></a>
<a class="ant-dropdown-link" v-else-if="row.status===1" @click="enable(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
@ -48,40 +48,27 @@
@addClose="addClose"
:editId="editId"
></addForm>
<detailForm :detailId="detailId" :show="drawer.detail" @detailClose="detailClose"></detailForm>
</div>
</template>
<script>
import { newsList, newsDel,itemSelect } from "@/api/operation/news/index.js";
import { routeList, routeDel,routeisEnable } from "@/api/operation/inspection/route.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue";
export default {
components: {
addForm,
detailForm
},
data() {
return {
drawer: {
show: false,
detail:false
},
editId: null,
detailId:null,
tableData: [],
searchForm: {
activityAddress: undefined,
organizerName: undefined,
activityContact: undefined,
activityTel: undefined,
title: undefined,
status: undefined,
registrationStartTime: undefined,
registrationEndTime: undefined,
activityStartTime: undefined,
activityEndTime: undefined,
code: undefined,
name: undefined,
},
formItem,
columns,
@ -92,7 +79,6 @@ export default {
},
mounted() {
this.getData();
this.getItem();
},
methods: {
async getData(data) {
@ -101,24 +87,14 @@ export default {
this.searchForm = data;
console.log(this.searchForm);
}
let res = await newsList({
let res = await routeList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
},
changeTime(data,start,end){
console.log(start);
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
console.log(this.searchForm);
this.selectedRowKeys = []
},
edit(id) {
this.editId = id;
@ -132,7 +108,7 @@ export default {
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await newsDel({ informationIds: ids });
let res = await routeDel({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
@ -142,6 +118,15 @@ export default {
},
});
},
async enable(id) {
let res = await routeisEnable({ routeId: id });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
@ -166,14 +151,6 @@ export default {
success() {
this.getData();
},
detail(id){
this.drawer.detail = true;
this.detailId = id;
},
detailClose(){
this.detailId = null;
this.drawer.detail = false;
}
},
computed: {
hasSelected() {

15934
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save