Compare commits
10 Commits
ad46e424dc
...
d0cbc441f0
Author | SHA1 | Date |
---|---|---|
“yyffkk” | d0cbc441f0 | 2 years ago |
张雄 | 49b2291f0f | 2 years ago |
张雄 | 5bebf8966b | 3 years ago |
张雄 | e356554695 | 3 years ago |
张雄 | 1985d5c491 | 3 years ago |
张雄 | 90f1f8dad4 | 3 years ago |
张雄 | e69000485d | 3 years ago |
张雄 | 5d58cb6627 | 3 years ago |
张雄 | 3a8710dbb8 | 3 years ago |
张雄 | 0e4bd62bb0 | 3 years ago |
@ -1,3 +1,3 @@
|
||||
NODE_ENV = 'development'
|
||||
VUE_APP_URL = 'http://121.41.26.225:8004/'
|
||||
VUE_APP_STATIC = 'https://saas.kaidalai.cn/resource/'
|
||||
VUE_APP_URL = 'http://127.0.0.1:8004/'
|
||||
VUE_APP_STATIC = 'http://127.0.0.1:8004/resource/'
|
@ -1,3 +1,3 @@
|
||||
NODE_ENV = 'production'
|
||||
VUE_APP_URL = 'https://saas.kaidalai.cn/api/'
|
||||
VUE_APP_STATIC = 'https://saas.kaidalai.cn/resource/'
|
||||
VUE_APP_URL = 'http://127.0.0.1:8004/api/'
|
||||
VUE_APP_STATIC = 'http://127.0.0.1:8004/resource/'
|
@ -0,0 +1,10 @@
|
||||
import httpService from "@/request";
|
||||
|
||||
// 获取table表格
|
||||
export function GetTableData(params) {
|
||||
return httpService({
|
||||
url: `/user/protectionRegistration/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
// 查询所有的违禁关键字
|
||||
export function getForbiddenList(params) {
|
||||
return httpService({
|
||||
url: `/user/prohibitedKeywords/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加违禁字
|
||||
export function addForbidden(params) {
|
||||
return httpService({
|
||||
url: `/user/prohibitedKeywords/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除违禁字
|
||||
export function deleteForbidden(params) {
|
||||
return httpService({
|
||||
url: `/user/prohibitedKeywords/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id查询违禁字
|
||||
export function findForbidden(params) {
|
||||
return httpService({
|
||||
url: `/user/prohibitedKeywords/findById`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改违禁字
|
||||
export function updateForbidden(params) {
|
||||
return httpService({
|
||||
url: `/user/prohibitedKeywords/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
///类型
|
||||
// 查询所有业委会类型信息
|
||||
export function getComList(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommitteeType/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加业委会类型
|
||||
export function addComType(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommitteeType/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改业委会类型
|
||||
export function updateComType(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommitteeType/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除业委会类型
|
||||
export function delComType(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommitteeType/delete`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
///信息
|
||||
// 查询所有业委会信息
|
||||
export function getIndustryCommitteeList(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommittee/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加业委会信息
|
||||
export function addIndustryCom(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommittee/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除业委会信息
|
||||
export function delIndustryCom(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommittee/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据业委会主键id查询业委会信息
|
||||
export function findIndustryCom(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommittee/findById`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改业委会信息
|
||||
export function updateIndustryCom(params) {
|
||||
return httpService({
|
||||
url: `/user/industryCommittee/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
//分类
|
||||
// 查询所有的分类
|
||||
export function getRegistersList(params) {
|
||||
return httpService({
|
||||
url: `/user/protectionRegistration/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function add(params) {
|
||||
return httpService({
|
||||
url: `/user/protectionRegistration/add`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function protectionRegistrationDelete(params) {
|
||||
return httpService({
|
||||
url: `/user/protectionRegistration/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export function registerExport(params) {
|
||||
return httpService({
|
||||
url: `/user/protectionRegistration/export`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function getReturnRegistersList(params) {
|
||||
return httpService({
|
||||
url: `/user/returnRegistration/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getClockOnList(params) {
|
||||
return httpService({
|
||||
url: `/user/epidemicClockOn/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
export function epidemicClockOnDelete(params) {
|
||||
return httpService({
|
||||
url: `/user/epidemicClockOn/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
export function returnRegistrationDelete(params) {
|
||||
return httpService({
|
||||
url: `/user/returnRegistration/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,112 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
//分类
|
||||
// 查询所有的设施/设备分类
|
||||
export function getFacilitiesList(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesCategory/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加设施/设备分类信息
|
||||
export function addFacility(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesCategory/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除设施/设备分类
|
||||
export function delFacility(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesCategory/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据设施/设备分类主键id查询设施/设备分类信息
|
||||
export function findFacility(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesCategory/findById`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设施分类信息(不允许修改设施分类类型)
|
||||
export function updateFacility(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesCategory/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
//管理
|
||||
// 查询所有的设施/设备管理
|
||||
export function facilityInfoList(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesManage/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加设施/设备信息
|
||||
export function addFacilityInfo(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesManage/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据设施/设备主键id查询设施/设备信息
|
||||
export function findFacilityInfo(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesManage/findById`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据设施/设备主键id查询设施/设备情况list记录
|
||||
export function findRecordList(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesManage/situationList`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设施/设备信息
|
||||
export function updateFacilityInfo(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesManage/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除设施/设备信息
|
||||
export function delFacilityInfo(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesManage/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
//预约
|
||||
//查询所有的设施设备预约
|
||||
export function getFacilitiesReserve(params) {
|
||||
return httpService({
|
||||
url: `/user/facilitiesReserve/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
// 查询所有问卷调查信息
|
||||
export function getQuestionList(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加问卷调查表信息
|
||||
export function addQuestion(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 更新问卷调查表信息
|
||||
export function updateQuestion(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除问卷调查信息
|
||||
export function delQuestion(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 发布下架问卷调查
|
||||
export function releaseQuestion(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/isRelease`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据问卷调查主键ID查询问卷调查信息
|
||||
export function findQuestion(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/findById`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据问卷调查主键id查询报表分析信息
|
||||
export function getReport(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/reportAnalysis`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据题目主键id查询开放题内容信息列表
|
||||
export function getAnswerList(params) {
|
||||
return httpService({
|
||||
url: `/user/questionnaire/shortAnswerList`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
// 查询所有投票信息
|
||||
export function getVoteList(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/list`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 添加投票信息
|
||||
export function addVote(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/insert`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除投票信息
|
||||
export function deleteVote(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/delete`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据投票主键id查询投票信息
|
||||
export function findVote(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/findById`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改投票信息
|
||||
export function updateVote(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/update`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 发布下架投票
|
||||
export function releaseVote(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/isRelease`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询候选项信息(详情页面)
|
||||
export function getCandidateList(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/findCandidateList`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询候选人被投票信息(详情页面)
|
||||
export function getPersonalList(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/findPersonnelList`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 即将开始的投票个数
|
||||
export function getTodayVote(params) {
|
||||
return httpService({
|
||||
url: `/user/vote/countVoteExpectedStart`,
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
const requestUrl = {
|
||||
// 综合服务
|
||||
userProtectionRegistrationList:'user/protectionRegistration/list',
|
||||
userReturnRegistrationList:'user/registration/list',
|
||||
userEpidemicClockOnList:'user/epidemicClockOn/list'
|
||||
|
||||
|
||||
}
|
||||
export default requestUrl
|
@ -0,0 +1,28 @@
|
||||
import { GetTableData } from '@/api/basic'
|
||||
import {getRegistersList} from "@/api/operation/epidemic"
|
||||
export async function DownloadExcel(params, that) {
|
||||
let Excel = []
|
||||
console.log(params)
|
||||
console.log("1")
|
||||
params = params.data;
|
||||
const response = await GetTableData(params)
|
||||
Excel.push(...response.data.rows)
|
||||
if (response.pageCount > 1) {
|
||||
for (let i = 1; i < response.pageCount; i++) {
|
||||
params.pageNum = i + 1;
|
||||
const data1 =getRegistersList(params)
|
||||
const data = await GetTableData(params)
|
||||
that.ExcelLoading(i, response.pageCount)
|
||||
Excel.push(...data.data.rows)
|
||||
}
|
||||
}
|
||||
return Excel
|
||||
}
|
||||
|
||||
export async function partDownloadExcel(params) {
|
||||
let Excel = []
|
||||
const response = await GetTableData(params)
|
||||
console.log(response);
|
||||
Excel.push(...response.tableList)
|
||||
return Excel
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
import axios from 'axios'
|
||||
// ElementUI 单独引入
|
||||
import ElementUI from 'element-ui'
|
||||
import router from '../router'
|
||||
import qs from 'qs'
|
||||
// 创建实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.VUE_APP_API, // 请求地址
|
||||
withCredentials: false,
|
||||
timeout: 5000 // 超时
|
||||
})
|
||||
// axios
|
||||
|
||||
// 添加请求拦截器
|
||||
service.interceptors.request.use(
|
||||
function(config) {
|
||||
// 在发送请求之前做些什么
|
||||
config.headers['X-Admin-Token'] = sessionStorage.getItem(
|
||||
'X-Admin-Token'
|
||||
)
|
||||
// Access-Control-Allow-Origin: *
|
||||
return config
|
||||
},
|
||||
function(error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
// 添加响应拦截器
|
||||
service.interceptors.response.use(
|
||||
function(response) {
|
||||
const data = response.data
|
||||
// 未登录或登录失效
|
||||
if (data.code == '-1000') {
|
||||
ElementUI.Message.error(data.message)
|
||||
setTimeout(() => {
|
||||
router.replace({
|
||||
path: '/Login'
|
||||
})
|
||||
}, 500)
|
||||
|
||||
return response
|
||||
}else if(data.code =='-1001'){
|
||||
ElementUI.Message.error(data.message)
|
||||
|
||||
return response
|
||||
}else if(data.code =='400'){
|
||||
ElementUI.Message.error(data.message)
|
||||
|
||||
return response
|
||||
}else if(data.code =='401'){
|
||||
ElementUI.Message.error(data.message)
|
||||
|
||||
return response
|
||||
}else if(data.code =='404'){
|
||||
ElementUI.Message.error(data.message)
|
||||
|
||||
return response
|
||||
}else if(data.code =='500'){
|
||||
ElementUI.Message.error(data.message)
|
||||
|
||||
return response
|
||||
}else if(data.code =='503'){
|
||||
ElementUI.Message.error(data.message)
|
||||
|
||||
return response
|
||||
}
|
||||
if (data.status != true && data.status != null) {
|
||||
console.log(data);
|
||||
ElementUI.Message({message:data.message,type:'error'})
|
||||
return data
|
||||
} else {
|
||||
return data // return Promise.resolve(data);
|
||||
}
|
||||
return data
|
||||
},
|
||||
function(error) {
|
||||
// 对响应错误做点什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
// 暴露service
|
||||
export default service
|
@ -0,0 +1,25 @@
|
||||
export const columns = [
|
||||
{
|
||||
title: "违禁关键字",
|
||||
width: "33%",
|
||||
dataIndex: "keywords",
|
||||
},
|
||||
{
|
||||
title: "替换字符",
|
||||
width: "33%",
|
||||
dataIndex: "replaces",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "action",
|
||||
key: "action",
|
||||
width: "240",
|
||||
fixed: "right",
|
||||
scopedSlots: { customRender: "action" },
|
||||
},
|
||||
]
|
||||
|
||||
export const rules = {
|
||||
replaces: [{ required: true, message: "请输入替换的字符", trigger: "blur" }],
|
||||
keywords: [{ required: true, message: "请输入违禁字", trigger: "blur" }],
|
||||
}
|
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="cardTitle">
|
||||
<a-space size="large">
|
||||
<span>违禁字管理</span>
|
||||
</a-space>
|
||||
</div>
|
||||
<div class="search-box">
|
||||
<a-row>
|
||||
<a-col :span="20">
|
||||
<a-space size="large">
|
||||
<a-input v-model="form.keywords" style="width: 200px" placeholder="违禁关键字"></a-input>
|
||||
<a-input v-model="form.replaces" style="width: 200px" placeholder="替换字符"></a-input>
|
||||
<a-button type="primary" @click='getData'>查 询</a-button>
|
||||
<a-button @click='reset'>重 置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<a-button style="margin: 10px" class="add-btn" @click="detailShow = true;mode = 1">新增违禁字</a-button>
|
||||
<div class="main">
|
||||
<a-table :columns="columns" :data-source="tableData"
|
||||
:pagination="pagination" @change="handlerChange"
|
||||
:row-selection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: selectionChoosed,
|
||||
}"
|
||||
:row-key="
|
||||
(record, index) => {
|
||||
return record.id;
|
||||
}">
|
||||
<template slot="action" slot-scope="text,record">
|
||||
<span><a @click=edit(record)>编辑</a></span>
|
||||
<span><a style="margin-left: 8px;color:red" @click=del(record)>删除</a></span>
|
||||
</template>
|
||||
</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>
|
||||
</div>
|
||||
<a-drawer :title="mode==1?'新增违禁字':'编辑违禁字'" :width="720" :visible="detailShow" :body-style="{ paddingBottom: '60px' }" @close="detailClose">
|
||||
<div class="drawer-content">
|
||||
<span>违禁字信息</span>
|
||||
<a-divider></a-divider>
|
||||
<a-row>
|
||||
<a-form-model :model="addForm" :rules="rules">
|
||||
<a-col :span="12">
|
||||
<a-form-model-item label="违禁关键字" prop="keywords">
|
||||
<a-input style="width: 240px" v-model="addForm.keywords"></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item label="替换字符" prop="replaces">
|
||||
<a-input style="width: 240px" v-model="addForm.replaces"></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-form-model>
|
||||
</a-row>
|
||||
</div>
|
||||
<div class="drawer-footer" style="float: left">
|
||||
<a-button @click="addConfirm" type="primary" :style="{ marginRight: '8px' }">
|
||||
确认
|
||||
</a-button>
|
||||
<a-button @click="detailClose"> 关闭 </a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getForbiddenList, addForbidden, findForbidden, updateForbidden, deleteForbidden} from "@/api/basic/forbidden"
|
||||
import { rules, columns } from "./depend/config";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
keywords: '',
|
||||
replaces: ''
|
||||
},
|
||||
addForm: {
|
||||
keywords: '',
|
||||
replaces: ''
|
||||
},
|
||||
mode: 1, //1新增 2编辑
|
||||
activeId: undefined,
|
||||
activeName: 0,
|
||||
rules: rules,
|
||||
columns: columns,
|
||||
tableData: [],
|
||||
pagination: {
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
},
|
||||
//详情
|
||||
detailShow: false,
|
||||
//批量删除
|
||||
selectedRowKeys: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let obj = Object.assign(this.form, {pageNum: this.pagination.current,size: this.pagination.pageSize})
|
||||
getForbiddenList(obj).then(res => {
|
||||
this.tableData = res.data.rows;
|
||||
this.pagination.total = res.data.total
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
keywords: '',
|
||||
replaces: ''
|
||||
},
|
||||
this.getData()
|
||||
},
|
||||
handlerChange() {
|
||||
this.pagination.current = val.current;
|
||||
this.pagination.pageSize = val.pageSize;
|
||||
this.getData()
|
||||
},
|
||||
detailClose() {
|
||||
this.addForm = {
|
||||
name: '',
|
||||
tel: '',
|
||||
type: undefined,
|
||||
status: undefined,
|
||||
weight: 0,
|
||||
}
|
||||
this.detailShow = false
|
||||
},
|
||||
//添加电话
|
||||
addConfirm() {
|
||||
if(this.mode == 1) {
|
||||
addForbidden(this.addForm).then(res => {
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.detailClose()
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let obj = Object.assign(this.addForm, {id: this.activeId})
|
||||
updateForbidden(obj).then(res => {
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.detailClose()
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//编辑
|
||||
edit(val) {
|
||||
this.mode = 2;
|
||||
findForbidden({prohibitedKeywordsId: val.id}).then(res => {
|
||||
let data = res.data;
|
||||
this.addForm = {
|
||||
keywords: data.keywords,
|
||||
replaces: data.replaces,
|
||||
},
|
||||
this.activeId = data.id
|
||||
})
|
||||
this.detailShow = true;
|
||||
},
|
||||
//删除
|
||||
del(val) {
|
||||
this.$confirm({
|
||||
title: "是否删除该违禁字?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await deleteForbidden({prohibitedKeywordsIds: [val.id]})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
//批量删除
|
||||
selectionChoosed(val) {
|
||||
this.selectedRowKeys = val
|
||||
},
|
||||
handleMenuClick(data) {
|
||||
if (data.key === "del") {
|
||||
this.$confirm({
|
||||
title: "是否删除选中的违禁字?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await deleteForbidden({prohibitedKeywordsIds: this.selectedRowKeys})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.selectedRowKeys = [];
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
hasSelected() {
|
||||
return this.selectedRowKeys.length > 0;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.drawer-content {
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>test</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-drawer title="职位设置" :width="540" :visible="show" :body-style="{ paddingBottom: '80px' }" @close="addClose">
|
||||
<div class="drawer-content" style="padding: 16px">
|
||||
职位类型
|
||||
<a-divider></a-divider>
|
||||
<!-- tags -->
|
||||
<span v-for="item,index in typeList" :key="item.id">
|
||||
<a-input
|
||||
v-if="item.show==true"
|
||||
ref="input"
|
||||
v-focus
|
||||
type="text"
|
||||
size="small"
|
||||
:style="{ width: '78px','padding-bottom':'3px','margin-right':'7px' }"
|
||||
v-model="item.name"
|
||||
@blur="editType(item)"
|
||||
@keyup.enter="editType(item)"
|
||||
/>
|
||||
<a-tag
|
||||
v-else-if="item.show==false" closable @close.prevent="delType(item.id)"
|
||||
@click="editInput(item,index)" >
|
||||
{{item.name}}
|
||||
</a-tag>
|
||||
</span>
|
||||
<!-- addTag -->
|
||||
<span>
|
||||
<a-input
|
||||
v-if="inputVisible"
|
||||
ref="addInput"
|
||||
type="text"
|
||||
size="small"
|
||||
:style="{ width: '78px','padding-bottom':'3px'}"
|
||||
:value="typeForm.name"
|
||||
@change="handleInputChange"
|
||||
@blur="handleInputConfirm"
|
||||
@keyup.enter="handleInputConfirm"
|
||||
/>
|
||||
<a-tag v-else style="background: #fff; borderStyle: dashed;" @click="addShow">
|
||||
<a-icon type="plus" /> 新增类型
|
||||
</a-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div class="drawer-footer">
|
||||
<a-button :style="{ marginRight: '8px' }" @click="addClose">
|
||||
关闭
|
||||
</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {getPhontTypeList, addPhontType, delPhontType,updatePhontType} from "@/api/operation/suggestion"
|
||||
import {getComList, addComType, updateComType, delComType} from "@/api/operation/commission"
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
typeForm: {
|
||||
name: ''
|
||||
},
|
||||
typeList: [],
|
||||
inputVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
async getData() {
|
||||
this.typeList = []
|
||||
const res = await getComList();
|
||||
const arr = res.data;
|
||||
arr.forEach(ele => {
|
||||
ele.show = false;
|
||||
})
|
||||
this.typeList = arr;
|
||||
this.$emit("refresh");
|
||||
},
|
||||
//输入
|
||||
editInput(obj, i) {
|
||||
this.$set(this.typeList[i],'show',true)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
//新增
|
||||
addShow(){
|
||||
this.inputVisible = true;
|
||||
this.$nextTick(function() {
|
||||
this.$refs.addInput.focus();
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
async editType(item){
|
||||
let res = await updateComType({
|
||||
id: item.id,
|
||||
name: item.name
|
||||
})
|
||||
if(res.code === 200){
|
||||
item.show = false
|
||||
this.$forceUpdate()
|
||||
this.$message.success(res.msg)
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
},
|
||||
handleInputChange(e) {
|
||||
this.typeForm.name = e.target.value;
|
||||
},
|
||||
//新增和编辑确认
|
||||
async handleInputConfirm() {
|
||||
if(this.typeForm.name === ''){
|
||||
this.inputVisible = false;
|
||||
return
|
||||
}
|
||||
let res = await addComType({
|
||||
name:this.typeForm.name,
|
||||
})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.inputVisible = false;
|
||||
this.typeForm.name = '';
|
||||
this.getData()
|
||||
}else{
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
//删除
|
||||
delType(id){
|
||||
this.$confirm({
|
||||
title: "是否删除",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await delComType({industryCommitteeTypeId: id})
|
||||
if(res.code=== 200){
|
||||
this.$message.success(res.msg);
|
||||
this.getData()
|
||||
}else{
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
addClose() {
|
||||
this.$emit("addClose");
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
</style>
|
@ -0,0 +1,36 @@
|
||||
export const columns = [
|
||||
{
|
||||
title: "成员姓名",
|
||||
width: "15%",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "职位",
|
||||
width: "15%",
|
||||
dataIndex: "industryCommitteeTypeName",
|
||||
},
|
||||
{
|
||||
title: "关联房屋",
|
||||
width: "25%",
|
||||
dataIndex: "buildingName",
|
||||
scopedSlots: { customRender: "house" },
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
width: "20%",
|
||||
dataIndex: "createDate",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "action",
|
||||
key: "action",
|
||||
width: "180",
|
||||
fixed: "right",
|
||||
scopedSlots: { customRender: "action" },
|
||||
},
|
||||
]
|
||||
|
||||
export const rules = {
|
||||
appUserId: [{ required: true, message: "请选择住户", trigger: "change" }],
|
||||
industryCommitteeTypeId: [{ required: true, message: "请选择职位", trigger: "change" }],
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
export const formItem = [
|
||||
{
|
||||
type: 'select',
|
||||
label:'综合搜索',
|
||||
prop:'comprehensiveSearchNumber',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:1,name:'姓名'},{ id:2,name:'手机号'},{ id:3,name:'身份证号'}]
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
|
||||
prop:'comprehensiveSearch',
|
||||
placeholder:'',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label:'居住房屋',
|
||||
prop:'residentialHousing',
|
||||
placeholder:'楼栋-单元-房间号',
|
||||
},
|
||||
{
|
||||
type: 'time',
|
||||
label:'记录时间',
|
||||
prop:'create',
|
||||
start: 'createStartDate',
|
||||
end: 'createEndDate'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'是否健康',
|
||||
prop:'isHealthy',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:1,name:'是'},{ id:2,name:'否'}]
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'是否接触过阳性',
|
||||
prop:'whetherExposedToPositive',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:1,name:'是'},{ id:2,name:'否'}]
|
||||
}
|
||||
]
|
||||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
width:"5%"
|
||||
},
|
||||
{
|
||||
title: "房屋",
|
||||
dataIndex: "house",
|
||||
width:"5%"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "tel",
|
||||
width: "5%"
|
||||
},
|
||||
|
||||
{
|
||||
title: "身份证号",
|
||||
dataIndex: "idCard",
|
||||
width:"5%"
|
||||
},
|
||||
{
|
||||
title: "是否健康",
|
||||
dataIndex: "isHealthy",
|
||||
width: 30,
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '是'
|
||||
case 2:
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "是否到过疫区",
|
||||
dataIndex: "epidemicZone",
|
||||
width: "5%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '是'
|
||||
case 2:
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "是否接触过阳性",
|
||||
dataIndex: "whetherExposedToPositive",
|
||||
width:"5%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '是'
|
||||
case 2:
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "体温",
|
||||
dataIndex: "temperature",
|
||||
width:"5%"
|
||||
},
|
||||
{
|
||||
title: "记录时间",
|
||||
dataIndex: "recordTime",
|
||||
width:"5%"
|
||||
},
|
||||
{
|
||||
title:"备注",
|
||||
dataIndex:"remark",
|
||||
width:"5%"
|
||||
}
|
||||
|
||||
|
||||
|
||||
]
|
||||
export const pagination = {
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
export const form = {
|
||||
id:null,
|
||||
comprehensiveSearchNumber:undefined,
|
||||
comprehensiveSearch:undefined,
|
||||
residentialHousing:undefined,
|
||||
isHealthy:undefined,
|
||||
epidemicZone:undefined,
|
||||
whetherExposedToPositive:undefined,
|
||||
create:undefined
|
||||
|
||||
}
|
||||
export const rules = {
|
||||
comprehensiveSearchNumber:[{required:true,message:'请输入标题',trigger:'blur'}],
|
||||
comprehensiveSearch:[{required:true,message:'请输入内容',trigger:'blur'}],
|
||||
residentialHousing:[{required:true,message:'请选择',trigger:'change'}],
|
||||
isHealthy:[{required:true,message:'请选择',trigger:'change'}],
|
||||
epidemicZone:[{required:true,message:'请选择',trigger:'change'}],
|
||||
whetherExposedToPositive:[{required:true,message:'请选择',trigger:'change'}],
|
||||
create:[{required:true,message:'请选择',trigger:'change'}],
|
||||
|
||||
}
|
||||
export const options = {
|
||||
isTrue:[
|
||||
{ id:1, name:'是' },
|
||||
{ id:0, name:'否' },
|
||||
],
|
||||
status: [
|
||||
{ id:1, name:'启用中' },
|
||||
{ id:2, name:'禁用中' },
|
||||
]
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
<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-form-model-item prop="title" label="标题">
|
||||
<a-input
|
||||
v-model="form.title"
|
||||
placeholder="请输入标题"
|
||||
style="width: 60%"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="content" label="内容">
|
||||
<a-input
|
||||
v-model="form.content"
|
||||
placeholder="请输入标题"
|
||||
style="width: 60%"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="status" label="状态">
|
||||
<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="isPublic" label="是否公开">
|
||||
<a-select
|
||||
v-model="form.isPublic"
|
||||
placeholder="请选择"
|
||||
style="width: 60%"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in options.isTrue"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>{{ item.name }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="isRating" label="是否可以评论">
|
||||
<a-select
|
||||
v-model="form.isRating"
|
||||
placeholder="请选择"
|
||||
style="width: 60%"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in options.isTrue"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>{{ item.name }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
话题图片
|
||||
<commonUpload :fileList='fileList' @handleChange="handleChange" />
|
||||
</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 { topicInsert,topicUpdate, topicInfo } from '@/api/operation/dynamic/topic'
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
editId:Number
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "新增话题",
|
||||
form,
|
||||
rules,
|
||||
options,
|
||||
fileList:[]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
addClose() {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.fileList = []
|
||||
this.form.imgUrls = []
|
||||
this.$emit('addClose');
|
||||
},
|
||||
success() {
|
||||
this.$emit('success');
|
||||
this.addClose()
|
||||
},
|
||||
submit() {
|
||||
// console.log(this.form)
|
||||
this.$refs.ruleForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if(this.editId === null) {
|
||||
let res = await topicInsert(this.form)
|
||||
if(res.code===200){
|
||||
this.$message.success(res.msg)
|
||||
this.success()
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}else{
|
||||
let res = await topicUpdate(this.form)
|
||||
if(res.code===200){
|
||||
this.$message.success(res.msg)
|
||||
this.success()
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
// handleChange(imgDataList) {
|
||||
// this.fileList = imgDataList
|
||||
// let arr = []
|
||||
// imgDataList.forEach(ele => {
|
||||
// arr.push(ele.response.data)
|
||||
// })
|
||||
// this.form.imgUrls = arr
|
||||
// },
|
||||
handleChange(data) {
|
||||
this.fileList = data;
|
||||
this.form.imgUrls = [];
|
||||
data.forEach(ele => {
|
||||
if(ele.status == 'done') {
|
||||
this.form.imgUrls.push(ele.response.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
editId:{
|
||||
handler(val){
|
||||
if(val!==null){
|
||||
this.title = '修改话题'
|
||||
this.form.id = val
|
||||
this.form.imgUrls = [];
|
||||
topicInfo({topicId:val}).then(res=>{
|
||||
let data = res.data
|
||||
this.form.title = data.title
|
||||
this.form.content = data.content
|
||||
this.form.status = data.status
|
||||
this.form.isPublic = data.isPublic
|
||||
this.form.isRating = data.isRating
|
||||
if(data.imgList.length>0){
|
||||
const pic = []
|
||||
this.form.imgUrls.push(data.imgList[0].url)
|
||||
for(let item of 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.title = '新增话题'
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -0,0 +1,121 @@
|
||||
export const formItem = [
|
||||
{
|
||||
type: 'select',
|
||||
label:'综合搜索',
|
||||
prop:'comprehensiveSearchNumber',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:1,name:'姓名'},{ id:2,name:'手机号'},{ id:3,name:'身份证号'}]
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
prop:'comprehensiveSearch',
|
||||
placeholder:'',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label:'居住房屋',
|
||||
prop:'residentialHousing',
|
||||
placeholder:'楼栋-单元-房间号'
|
||||
},
|
||||
{
|
||||
type: 'time',
|
||||
label:'记录时间',
|
||||
prop:'create',
|
||||
start: 'createStartDate',
|
||||
end: 'createEndDate'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'进出类型',
|
||||
prop:'typeOfAccess',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:0,name:'全部'},{ id:1,name:'进入'},{ id:2,name:'外出'}]
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'进出事由',
|
||||
prop:'reasonsForEntryAndExit',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:0,name:'全部'},{ id:1,name:'回家'},{ id:2,name:'采购'},{id:3,name:'上班'},{id:4,name:'其他'}]
|
||||
}
|
||||
]
|
||||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
width:"5%",
|
||||
},
|
||||
{
|
||||
title: "房屋",
|
||||
dataIndex: "house",
|
||||
width: "5%",
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "tel",
|
||||
width:"5%",
|
||||
},
|
||||
{
|
||||
title: "进出类型",
|
||||
dataIndex: "typeOfAccess",
|
||||
width: "5%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '进入'
|
||||
case 2:
|
||||
return '外出'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
dataIndex: "idCard",
|
||||
width: "5%",
|
||||
},
|
||||
{
|
||||
title: "体温",
|
||||
dataIndex: "temperature",
|
||||
width:"5%",
|
||||
},
|
||||
{
|
||||
title: "记录时间",
|
||||
dataIndex: "recordTime",
|
||||
width: "5%",
|
||||
},
|
||||
{
|
||||
title: "进出事由",
|
||||
dataIndex: "reasonsForEntryAndExit",
|
||||
width: "5%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '回家'
|
||||
case 2:
|
||||
return '采购'
|
||||
case 3:
|
||||
return '上班'
|
||||
case 4:
|
||||
return '其他'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
width: "5%",
|
||||
},
|
||||
|
||||
|
||||
|
||||
]
|
||||
export const pagination = {
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
export const form = {
|
||||
id:null,
|
||||
comprehensiveSearchNumber:undefined,
|
||||
comprehensiveSearch:undefined,
|
||||
residentialHousing:undefined,
|
||||
create:undefined,
|
||||
|
||||
typeOfAccess:undefined,
|
||||
reasonsForEntryAndExit:undefined,
|
||||
|
||||
}
|
||||
export const rules = {
|
||||
comprehensiveSearchNumber:[{required:true,message:'请选择',trigger:'change'}],
|
||||
comprehensiveSearch:[{required:true,message:'请输入内容',trigger:'blur'}],
|
||||
residentialHousing:[{required:true,message:'请输入内容',trigger:'blur'}],
|
||||
create:[{required:true,message:'请选择',trigger:'change'}],
|
||||
typeOfAccess:[{required:true,message:'请选择',trigger:'change'}],
|
||||
|
||||
reasonsForEntryAndExit:[{required:true,message:'请选择',trigger:'change'}],
|
||||
}
|
||||
export const options = {
|
||||
isTrue:[
|
||||
{ id:1, name:'是' },
|
||||
{ id:0, name:'否' },
|
||||
],
|
||||
status: [
|
||||
{ id:1, name:'启用中' },
|
||||
{ id:2, name:'禁用中' },
|
||||
]
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
<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-form-model-item prop="title" label="姓名">
|
||||
<a-input
|
||||
v-model="form.title"
|
||||
placeholder="请输入标题"
|
||||
style="width: 60%"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="content" label="内容">
|
||||
<a-input
|
||||
v-model="form.content"
|
||||
placeholder="请输入标题"
|
||||
style="width: 60%"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="status" label="状态">
|
||||
<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="isPublic" label="是否公开">
|
||||
<a-select
|
||||
v-model="form.isPublic"
|
||||
placeholder="请选择"
|
||||
style="width: 60%"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in options.isTrue"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>{{ item.name }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="isRating" label="是否可以评论">
|
||||
<a-select
|
||||
v-model="form.isRating"
|
||||
placeholder="请选择"
|
||||
style="width: 60%"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in options.isTrue"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>{{ item.name }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
话题图片
|
||||
<commonUpload :fileList='fileList' @handleChange="handleChange" />
|
||||
</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 { topicInsert,topicUpdate, topicInfo } from '@/api/operation/dynamic/topic'
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
editId:Number
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "新增话题",
|
||||
form,
|
||||
rules,
|
||||
options,
|
||||
fileList:[]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
addClose() {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.fileList = []
|
||||
this.form.imgUrls = []
|
||||
this.$emit('addClose');
|
||||
},
|
||||
success() {
|
||||
this.$emit('success');
|
||||
this.addClose()
|
||||
},
|
||||
submit() {
|
||||
// console.log(this.form)
|
||||
this.$refs.ruleForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if(this.editId === null) {
|
||||
let res = await topicInsert(this.form)
|
||||
if(res.code===200){
|
||||
this.$message.success(res.msg)
|
||||
this.success()
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}else{
|
||||
let res = await topicUpdate(this.form)
|
||||
if(res.code===200){
|
||||
this.$message.success(res.msg)
|
||||
this.success()
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
// handleChange(imgDataList) {
|
||||
// this.fileList = imgDataList
|
||||
// let arr = []
|
||||
// imgDataList.forEach(ele => {
|
||||
// arr.push(ele.response.data)
|
||||
// })
|
||||
// this.form.imgUrls = arr
|
||||
// },
|
||||
handleChange(data) {
|
||||
this.fileList = data;
|
||||
this.form.imgUrls = [];
|
||||
data.forEach(ele => {
|
||||
if(ele.status == 'done') {
|
||||
this.form.imgUrls.push(ele.response.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
editId:{
|
||||
handler(val){
|
||||
if(val!==null){
|
||||
this.title = '修改话题'
|
||||
this.form.id = val
|
||||
this.form.imgUrls = [];
|
||||
topicInfo({topicId:val}).then(res=>{
|
||||
let data = res.data
|
||||
this.form.title = data.title
|
||||
this.form.content = data.content
|
||||
this.form.status = data.status
|
||||
this.form.isPublic = data.isPublic
|
||||
this.form.isRating = data.isRating
|
||||
if(data.imgList.length>0){
|
||||
const pic = []
|
||||
this.form.imgUrls.push(data.imgList[0].url)
|
||||
for(let item of 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.title = '新增话题'
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -0,0 +1,127 @@
|
||||
export const formItem = [
|
||||
{
|
||||
type: 'select',
|
||||
label:'综合搜索',
|
||||
prop:'comprehensiveSearchNumber',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:1,name:'姓名'},{ id:2,name:'手机号'},{ id:3,name:'身份证号'}]
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
prop:'comprehensiveSearch',
|
||||
placeholder:'',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label:'居住房屋',
|
||||
prop:'residentialHousing',
|
||||
placeholder:'楼栋-单元-房间号',
|
||||
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'是否健康',
|
||||
prop:'isHealthy',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:0,name:'全部'},{ id:1,name:'是'},{ id:2,name:'否'}]
|
||||
},
|
||||
{
|
||||
type: 'time',
|
||||
label:'记录时间',
|
||||
prop:'status'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'是否到过疫区',
|
||||
prop:'epidemicZone',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:0,name:'全部'},{ id:1,name:'是'},{ id:2,name:'否'}]
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label:'是否接触过阳性',
|
||||
prop:'whetherExposedToPositive',
|
||||
placeholder:'请选择',
|
||||
option:[{ id:0,name:'全部'},{ id:1,name:'是'},{ id:2,name:'否'}]
|
||||
},
|
||||
|
||||
]
|
||||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
title: "房屋",
|
||||
dataIndex: "house",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "tel",
|
||||
width:"10%",
|
||||
},
|
||||
{
|
||||
title: "是否健康",
|
||||
dataIndex: "isHealthy",
|
||||
width: "10%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '是'
|
||||
case 2:
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "是否到过疫区",
|
||||
dataIndex: "epidemicZone",
|
||||
width: "10%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '是'
|
||||
case 2:
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "是否接触过阳性",
|
||||
dataIndex: "whetherExposedToPositive",
|
||||
width: "10%",
|
||||
customRender: function (status) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '是'
|
||||
case 2:
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "体温",
|
||||
dataIndex: "temperature",
|
||||
width: "10%"
|
||||
},
|
||||
{
|
||||
title: "记录时间",
|
||||
dataIndex: "recordTime",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
width: "10%",
|
||||
},
|
||||
]
|
||||
export const pagination = {
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
export const form = {
|
||||
id:null,
|
||||
comprehensiveSearchNumber:undefined,
|
||||
comprehensiveSearch:undefined,
|
||||
residentialHousing:undefined,
|
||||
isHealthy:undefined,
|
||||
epidemicZone:undefined,
|
||||
whetherExposedToPositive:undefined,
|
||||
}
|
||||
export const rules = {
|
||||
comprehensiveSearchNumber:[{required:true,message:'请输入标题',trigger:'blur'}],
|
||||
comprehensiveSearch:[{required:true,message:'请输入内容',trigger:'blur'}],
|
||||
residentialHousing:[{required:true,message:'请选择',trigger:'change'}],
|
||||
isHealthy:[{required:true,message:'请选择',trigger:'change'}],
|
||||
epidemicZone:[{required:true,message:'请选择',trigger:'change'}],
|
||||
whetherExposedToPositive:[{required:true,message:'请选择',trigger:'change'}]
|
||||
|
||||
}
|
||||
export const options = {
|
||||
isTrue:[
|
||||
{ id:1, name:'是' },
|
||||
{ id:0, name:'否' },
|
||||
],
|
||||
status: [
|
||||
{ id:1, name:'启用中' },
|
||||
{ id:2, name:'禁用中' },
|
||||
]
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
<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-form-model-item prop="title" label="标题">
|
||||
<a-input
|
||||
v-model="form.title"
|
||||
placeholder="请输入标题"
|
||||
style="width: 60%"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="content" label="内容">
|
||||
<a-input
|
||||
v-model="form.content"
|
||||
placeholder="请输入标题"
|
||||
style="width: 60%"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="status" label="状态">
|
||||
<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="isPublic" label="是否公开">
|
||||
<a-select
|
||||
v-model="form.isPublic"
|
||||
placeholder="请选择"
|
||||
style="width: 60%"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in options.isTrue"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>{{ item.name }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="isRating" label="是否可以评论">
|
||||
<a-select
|
||||
v-model="form.isRating"
|
||||
placeholder="请选择"
|
||||
style="width: 60%"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in options.isTrue"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
>{{ item.name }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
话题图片
|
||||
<commonUpload :fileList='fileList' @handleChange="handleChange" />
|
||||
</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 { topicInsert,topicUpdate, topicInfo } from '@/api/operation/dynamic/topic'
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
editId:Number
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "新增话题",
|
||||
form,
|
||||
rules,
|
||||
options,
|
||||
fileList:[]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
addClose() {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.fileList = []
|
||||
this.form.imgUrls = []
|
||||
this.$emit('addClose');
|
||||
},
|
||||
success() {
|
||||
this.$emit('success');
|
||||
this.addClose()
|
||||
},
|
||||
submit() {
|
||||
// console.log(this.form)
|
||||
this.$refs.ruleForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if(this.editId === null) {
|
||||
let res = await topicInsert(this.form)
|
||||
if(res.code===200){
|
||||
this.$message.success(res.msg)
|
||||
this.success()
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}else{
|
||||
let res = await topicUpdate(this.form)
|
||||
if(res.code===200){
|
||||
this.$message.success(res.msg)
|
||||
this.success()
|
||||
}else{
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
// handleChange(imgDataList) {
|
||||
// this.fileList = imgDataList
|
||||
// let arr = []
|
||||
// imgDataList.forEach(ele => {
|
||||
// arr.push(ele.response.data)
|
||||
// })
|
||||
// this.form.imgUrls = arr
|
||||
// },
|
||||
handleChange(data) {
|
||||
this.fileList = data;
|
||||
this.form.imgUrls = [];
|
||||
data.forEach(ele => {
|
||||
if(ele.status == 'done') {
|
||||
this.form.imgUrls.push(ele.response.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
editId:{
|
||||
handler(val){
|
||||
if(val!==null){
|
||||
this.title = '基本详情'
|
||||
this.form.id = val
|
||||
this.form.imgUrls = [];
|
||||
topicInfo({topicId:val}).then(res=>{
|
||||
let data = res.data
|
||||
this.form.title = data.title
|
||||
this.form.content = data.content
|
||||
this.form.status = data.status
|
||||
this.form.isPublic = data.isPublic
|
||||
this.form.isRating = data.isRating
|
||||
if(data.imgList.length>0){
|
||||
const pic = []
|
||||
this.form.imgUrls.push(data.imgList[0].url)
|
||||
for(let item of 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.title = '新增话题'
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="cardTitle">新冠返程登记</div>
|
||||
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm>
|
||||
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
|
||||
>下载登记二维码</a-button
|
||||
>
|
||||
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
|
||||
>EXCEL导出</a-button
|
||||
>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="tableData"
|
||||
:pagination="pagination"
|
||||
:scroll="{ x: 2400 }"
|
||||
@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="edit(row.id)">详情</a>
|
||||
|
||||
</a-space>
|
||||
</span>
|
||||
<span slot="imgpic" slot-scope="text, row">
|
||||
<img
|
||||
v-if="row.imgList.length > 0"
|
||||
:src="$ImgUrl(row.imgList[0].url)"
|
||||
class="table-img"
|
||||
alt=""
|
||||
/>
|
||||
<span v-else>无图片</span>
|
||||
</span>
|
||||
<span slot="switch" slot-scope="switchV, row">
|
||||
<a-switch
|
||||
checked-children="开"
|
||||
un-checked-children="关"
|
||||
:checked="switchV === 1"
|
||||
@change="handleEnable(row)"
|
||||
></a-switch>
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getReturnRegistersList,returnRegistrationDelete} from "@/api/operation/epidemic/index.js";
|
||||
import { topicList, topicDelete } from "@/api/operation/dynamic/topic.js";
|
||||
import { formItem, columns, pagination } from "./depend/config";
|
||||
import addForm from "./depend/form.vue";
|
||||
export default {
|
||||
components: {
|
||||
addForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
drawer: {
|
||||
show: false,
|
||||
},
|
||||
editId: null,
|
||||
tableData: [],
|
||||
searchForm: {
|
||||
title: "",
|
||||
status: undefined,
|
||||
isPublic: undefined,
|
||||
isRating: undefined,
|
||||
},
|
||||
formItem,
|
||||
columns,
|
||||
pagination,
|
||||
// 选择的index
|
||||
selectedRowKeys: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
async getData() {
|
||||
let res = await getReturnRegistersList({
|
||||
pageNum: this.pagination.current,
|
||||
size: this.pagination.pageSize,
|
||||
...this.searchForm,
|
||||
});
|
||||
this.tableData = res.data.rows;
|
||||
this.pagination.total = res.data.total;
|
||||
},
|
||||
search(data){
|
||||
this.searchForm = data;
|
||||
this.getData()
|
||||
},
|
||||
edit(id) {
|
||||
this.editId = id;
|
||||
this.drawer.show = true;
|
||||
},
|
||||
del(ids) {
|
||||
this.$confirm({
|
||||
title: "是否删除",
|
||||
// okText:'删除',
|
||||
// cancelText:'取消',
|
||||
icon: "delete",
|
||||
onOk: async () => {
|
||||
let res = await returnRegistrationDelete({ returnRegistrationIds: 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) {
|
||||
if (data.key === "del") {
|
||||
this.del(this.selectedRowKeys);
|
||||
}
|
||||
},
|
||||
handleTableChange(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();
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
hasSelected() {
|
||||
return this.selectedRowKeys.length > 0;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.table-img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<div>
|
||||
hello
|
||||
</div>
|
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
@ -0,0 +1,24 @@
|
||||
import JsonExcel from 'vue-json-excel'
|
||||
import { GetTableData } from '@/api/basic'
|
||||
export async function DownloadExcel(params, that) {
|
||||
let Excel = []
|
||||
const response = await GetTableData(params)
|
||||
Excel.push(...response.tableList)
|
||||
if (response.pageCount > 1) {
|
||||
for (let i = 1; i < response.pageCount; i++) {
|
||||
params.pageNum = i + 1
|
||||
const data = await GetTableData(params)
|
||||
that.ExcelLoading(i, response.pageCount)
|
||||
Excel.push(...data.tableList)
|
||||
}
|
||||
}
|
||||
return Excel
|
||||
}
|
||||
|
||||
export async function partDownloadExcel(params) {
|
||||
let Excel = []
|
||||
const response = await GetTableData(params)
|
||||
console.log(response);
|
||||
Excel.push(...response.tableList)
|
||||
return Excel
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
|
||||
<div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default({
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
},
|
||||
created(){
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
@ -0,0 +1,141 @@
|
||||
export const form= {
|
||||
type: 1,
|
||||
name: '',
|
||||
facilitiesCategoryId: undefined,
|
||||
code: '',
|
||||
status: undefined,
|
||||
createStartDate: undefined,
|
||||
createEndDate: undefined,
|
||||
}
|
||||
|
||||
export const addForm = {
|
||||
name: '',
|
||||
address: '',
|
||||
facilitiesCategoryId: undefined,
|
||||
brand: '',
|
||||
procurementCosts: '',
|
||||
purchasingManufacturer: '',
|
||||
manufacturerPhone: '',
|
||||
warrantyPeriodYears: 0,
|
||||
warrantyPeriodMonths: 0,
|
||||
validityStart: '',
|
||||
validityEnd: '',
|
||||
openStartDate: '',
|
||||
openEndDate: '',
|
||||
remakes: '',
|
||||
docUrls: [],
|
||||
}
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: "设施编号",
|
||||
width: "10%",
|
||||
dataIndex: "code",
|
||||
},
|
||||
{
|
||||
title: "设施分类名称",
|
||||
width: "8%",
|
||||
dataIndex: "facilitiesCategoryName",
|
||||
},
|
||||
{
|
||||
title: "设施名称",
|
||||
width: "9%",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "添加人",
|
||||
width: "8%",
|
||||
dataIndex: "createName",
|
||||
},
|
||||
{
|
||||
title: "设施状态",
|
||||
width: "8%",
|
||||
dataIndex: "status",
|
||||
customRender: function(status) {
|
||||
switch(status) {
|
||||
case 1: return '空置中'
|
||||
case 2: return '使用中'
|
||||
case 3: return '已停用'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "设施品牌",
|
||||
width: "8%",
|
||||
dataIndex: "brand",
|
||||
},
|
||||
{
|
||||
title: "采购费用(元)",
|
||||
width: "8%",
|
||||
dataIndex: "procurementCosts",
|
||||
},
|
||||
{
|
||||
title: "采购厂家",
|
||||
width: "8%",
|
||||
dataIndex: "purchasingManufacturer",
|
||||
},
|
||||
{
|
||||
title: "厂家电话",
|
||||
width: "8%",
|
||||
dataIndex: "manufacturerPhone",
|
||||
},
|
||||
{
|
||||
title: "质保期限",
|
||||
width: "6%",
|
||||
dataIndex: "warrantyPeriodYears",
|
||||
scopedSlots: { customRender: "quality" },
|
||||
},
|
||||
{
|
||||
title: "设备有效期",
|
||||
width: "16%",
|
||||
dataIndex: "validityStart",
|
||||
scopedSlots: { customRender: "time" },
|
||||
},
|
||||
// {
|
||||
// title: "设备有效期开始",
|
||||
// width: "8%",
|
||||
// dataIndex: "validityStart",
|
||||
// },
|
||||
// {
|
||||
// title: "设备有效期结束",
|
||||
// width: "8%",
|
||||
// dataIndex: "validityEnd",
|
||||
// },
|
||||
{
|
||||
title: "文件",
|
||||
width: "12%",
|
||||
dataIndex: "docList",
|
||||
scopedSlots: { customRender: "document" },
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
width: "8%",
|
||||
dataIndex: "remakes",
|
||||
},
|
||||
{
|
||||
title: "添加时间",
|
||||
width: "16%",
|
||||
dataIndex: "createDate",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "action",
|
||||
key: "action",
|
||||
width: "180",
|
||||
fixed: "right",
|
||||
scopedSlots: { customRender: "action" },
|
||||
},
|
||||
]
|
||||
|
||||
export const rules = {
|
||||
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||
content: [{ required: true, message: "请输入内容", trigger: "blur" }],
|
||||
}
|
||||
|
||||
export function doStr(str, number) {
|
||||
if(str.length >= number) {
|
||||
return str.substr(0,number-1) + '...'
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
export const columns = [
|
||||
{
|
||||
title: "预约时间",
|
||||
width: "10%",
|
||||
dataIndex: "createDate",
|
||||
},
|
||||
{
|
||||
title: "预约编号",
|
||||
width: "12%",
|
||||
dataIndex: "code",
|
||||
},
|
||||
{
|
||||
title: "预约状态",
|
||||
width: "7%",
|
||||
dataIndex: "status",
|
||||
customRender: function (type) {
|
||||
switch (type) {
|
||||
case 1: return '未签到'
|
||||
case 2: return '已签到'
|
||||
case 3: return '已作废'
|
||||
case 4: return '已取消'
|
||||
case 5: return '已结束'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "预约人",
|
||||
width: "7%",
|
||||
dataIndex: "reservationPerson",
|
||||
},
|
||||
{
|
||||
title: "预约人名称",
|
||||
width: "7%",
|
||||
dataIndex: "reservationPersonName",
|
||||
},
|
||||
{
|
||||
title: "预约开始时间",
|
||||
width: "10%",
|
||||
dataIndex: "reserveStartDate",
|
||||
},
|
||||
{
|
||||
title: "预约结束时间",
|
||||
width: "10%",
|
||||
dataIndex: "reserveEndDate",
|
||||
},
|
||||
{
|
||||
title: "用户反馈内容",
|
||||
width: "10%",
|
||||
dataIndex: "feedback",
|
||||
},
|
||||
{
|
||||
title: "作废原因",
|
||||
width: "12%",
|
||||
dataIndex: "nullifyReason",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "action",
|
||||
key: "action",
|
||||
width: "180",
|
||||
fixed: "right",
|
||||
scopedSlots: { customRender: "action" },
|
||||
},
|
||||
]
|
||||
|
||||
export const replyColumns = [
|
||||
{
|
||||
title: "创建人",
|
||||
width: "43%",
|
||||
dataIndex: "createUserType",
|
||||
scopedSlots: { customRender: "create" },
|
||||
},
|
||||
{
|
||||
title: "反馈内容",
|
||||
width: "43%",
|
||||
dataIndex: "content",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "action",
|
||||
key: "action",
|
||||
width: "13%",
|
||||
scopedSlots: { customRender: "action" },
|
||||
},
|
||||
]
|
@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="cardTitle">
|
||||
<a-space size="large">
|
||||
<span>预约管理</span>
|
||||
<a-radio-group
|
||||
v-model="form.status"
|
||||
button-style="solid"
|
||||
@change="typeChange"
|
||||
>
|
||||
<a-radio-button :value="undefined"> 全部 </a-radio-button>
|
||||
<a-radio-button :value="1"> 未签到 </a-radio-button>
|
||||
<a-radio-button :value="2"> 已签到 </a-radio-button>
|
||||
<a-radio-button :value="3"> 已作废 </a-radio-button>
|
||||
<a-radio-button :value="4"> 已取消 </a-radio-button>
|
||||
<a-radio-button :value="5"> 已结束 </a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-space>
|
||||
</div>
|
||||
<div class="search-box">
|
||||
<a-row>
|
||||
<a-col :span="20">
|
||||
<a-space size="large">
|
||||
<a-input v-model="form.code" style="width: 200px" placeholder="预约编号"></a-input>
|
||||
<a-select v-model="form.type" style="width: 200px" placeholder="预约类型">
|
||||
<a-select-option :value="0">未反馈</a-select-option>
|
||||
<a-select-option :value="1">反馈中</a-select-option>
|
||||
<a-select-option :value="2">已反馈</a-select-option>
|
||||
</a-select>
|
||||
<a-select v-model="form.facilitiesCategoryId" style="width: 200px" placeholder="分类">
|
||||
<a-select-option :value="0">差评</a-select-option>
|
||||
<a-select-option :value="1">中评</a-select-option>
|
||||
<a-select-option :value="2">好评</a-select-option>
|
||||
</a-select>
|
||||
<a-input v-model="form.name" style="width: 200px" placeholder="名称"></a-input>
|
||||
<a-range-picker @change="handlerTime" v-model="selTime" style="width: 240px" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="['创建时间开始','创建时间结束']"></a-range-picker>
|
||||
<a-button type="primary" @click='getData'>查 询</a-button>
|
||||
<a-button @click='reset'>重 置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<div class="main">
|
||||
<a-table :columns="columns" :data-source="tableData"
|
||||
:pagination="pagination" @change="handlerChange" :scroll="{ x: 2100 }"
|
||||
:row-selection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: selectionChoosed,
|
||||
}"
|
||||
:row-key="
|
||||
(record, index) => {
|
||||
return record.id;
|
||||
}">
|
||||
<template slot="rate" slot-scope="text,record">
|
||||
<a-rate :default-value="(record.score/2.0)" disabled allow-half></a-rate>
|
||||
</template>
|
||||
<template slot="action">
|
||||
<!-- <span><a @click=detail(record)>详情</a></span>
|
||||
<span><a style="margin-left: 8px" @click=reply(record)>回复</a></span>
|
||||
<span><a style="margin-left: 8px;color:red" @click=del(record)>删除</a></span> -->
|
||||
</template>
|
||||
</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> -->
|
||||
</div>
|
||||
<a-drawer :title="activeTitle" :width="720" :visible="detailShow" :body-style="{ paddingBottom: '60px' }" @close="detailClose">
|
||||
<div class="drawer-content">
|
||||
<span>基本信息</span>
|
||||
<a-divider></a-divider>
|
||||
<a-descriptions style="padding: 16px" :column="1">
|
||||
<a-descriptions-item label="类型">
|
||||
{{adviceInfo.type==1?'咨询':2?'建议':3?'投诉':'表扬'}}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="照片">
|
||||
<img v-for="(item,index) in adviceInfo.imgUrl"
|
||||
:key="index" :src="$ImgUrl(item.url)" style="height: 90px;width: 160px" />
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="反馈内容">
|
||||
<a-table :columns="replyColumns" :data-source="adviceInfo.voUserAdviceDetailList" :pagination="false">
|
||||
<template slot="create" slot-scope="text,row">
|
||||
{{row.createName}}({{row.createUserType==1?'住户':'物业'}}) {{row.createDate}}
|
||||
</template>
|
||||
<template v-if="activeTitle=='回复'" slot="action" slot-scope="text,row">
|
||||
<a @click="singelReply(row)">回复</a>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="评分星级" v-if="activeTitle=='咨询详情'">
|
||||
<a-rate :value="(adviceInfo.score*1)/2.0" disabled allow-half></a-rate>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<div v-if="activeTitle=='回复'">
|
||||
<span>回复反馈</span>
|
||||
<a-divider></a-divider>
|
||||
<a-form-model :model="repForm" :rules="rules" style="padding: 16px" layout="inline">
|
||||
<a-form-model-item label="反馈" prop="content">
|
||||
<a-textarea v-model="repForm.content" :autoSize="{ minRows: 8}" placeholder="请输入回复反馈" style="width: 500px">
|
||||
</a-textarea>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drawer-footer" style="float: left">
|
||||
<a-button @click="replyConfirm" type="primary" :style="{ marginRight: '8px' }"> 确认 </a-button>
|
||||
<a-button @click="detailClose"> 关闭 </a-button>
|
||||
</div>
|
||||
<a-modal :visible="singelReplyVisible" title="回复" @ok="singleConfirm" @cancel="singelReplyVisible=false">
|
||||
<a-form-model-item label="回复">
|
||||
<a-textarea v-model="singleForm.content" :autoSize="{ minRows: 4}" placeholder="请输入回复内容" style="width: 500px">
|
||||
</a-textarea>
|
||||
</a-form-model-item>
|
||||
</a-modal>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getFacilitiesReserve } from "@/api/operation/facility"
|
||||
import { columns,replyColumns } from "./depend/config";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
status: undefined,
|
||||
code: '',
|
||||
type: undefined,
|
||||
facilitiesCategoryId: undefined,
|
||||
name: '',
|
||||
createDateStart: '',
|
||||
createDateEnd: '',
|
||||
},
|
||||
repForm: {
|
||||
appAdviceId: undefined,
|
||||
content: '',
|
||||
parentId: 0
|
||||
},
|
||||
singleForm: {
|
||||
appAdviceId: undefined,
|
||||
content: '',
|
||||
parentId: 0
|
||||
},
|
||||
selTime: [],
|
||||
rules: {
|
||||
content: [{ required: true, message: "请输入回复", trigger: "blur" }],
|
||||
},
|
||||
activeName: 0,
|
||||
columns: columns,
|
||||
replyColumns: replyColumns,
|
||||
tableData: [],
|
||||
pagination: {
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
//详情
|
||||
activeTitle: '',
|
||||
detailShow: false,
|
||||
adviceInfo: {voUserAdviceDetailList: []},
|
||||
//回复窗口
|
||||
singelReplyVisible: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let obj = Object.assign( this.form, {pageNum: this.pagination.current,size: this.pagination.pageSize})
|
||||
getFacilitiesReserve(obj).then(res => {
|
||||
this.pagination.total = res.data.total;
|
||||
this.tableData = res.data.rows
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
status: undefined,
|
||||
code: '',
|
||||
type: undefined,
|
||||
facilitiesCategoryId: undefined,
|
||||
name: '',
|
||||
createDateStart: '',
|
||||
createDateEnd: '',
|
||||
},
|
||||
this.selTime = [];
|
||||
this.getData();
|
||||
},
|
||||
handlerChange(val) {
|
||||
this.pagination.current = val.current;
|
||||
this.pagination.pageSize = val.pageSize;
|
||||
this.getData()
|
||||
},
|
||||
detailClose() {
|
||||
this.adviceInfo = {};
|
||||
this.repForm = {
|
||||
appAdviceId: undefined,
|
||||
content: '',
|
||||
parentId: 0
|
||||
},
|
||||
this.detailShow = false
|
||||
},
|
||||
//切换
|
||||
typeChange(val) {
|
||||
this.getData();
|
||||
},
|
||||
//改变时间
|
||||
handlerTime(val) {
|
||||
this.form.createDateStart = val[0];
|
||||
this.form.createDateEnd = val[1];
|
||||
},
|
||||
//回复和删除
|
||||
detail(val) {
|
||||
this.activeTitle = '咨询详情'
|
||||
adviceDetail({adviceId: val.id}).then(res => {
|
||||
let data = res.data;
|
||||
this.repForm.appAdviceId = data.id
|
||||
this.adviceInfo = data
|
||||
})
|
||||
this.detailShow = true;
|
||||
},
|
||||
reply(val) {
|
||||
this.activeTitle = '回复'
|
||||
adviceDetail({adviceId: val.id}).then(res => {
|
||||
let data = res.data;
|
||||
this.repForm.appAdviceId = data.id
|
||||
this.adviceInfo = data
|
||||
})
|
||||
this.detailShow = true;
|
||||
},
|
||||
replyConfirm() {
|
||||
replyDetail(this.repForm).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success(res.msg);
|
||||
this.detailClose();
|
||||
this.getData();
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
singleConfirm() {
|
||||
replyDetail(this.singleForm).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success(res.msg);
|
||||
this.singelReplyVisible = false;
|
||||
this.singleForm = {
|
||||
appAdviceId: undefined,
|
||||
content: '',
|
||||
parentId: 0
|
||||
},
|
||||
this.detailClose();
|
||||
this.getData();
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
singelReply(val) {
|
||||
this.singleForm.appAdviceId = this.adviceInfo.id
|
||||
this.singleForm.parentId = val.id
|
||||
this.singelReplyVisible = true
|
||||
},
|
||||
del(val) {
|
||||
if(val.status == 1 || val.status == 2) {
|
||||
this.$confirm({
|
||||
title: "该条信息您还未回复,是否删除?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await delAdvice({adviceIds: [val.id]})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
this.$confirm({
|
||||
title: "是否确认删除该信息?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await delAdvice({adviceIds: [val.id]})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
selectionChoosed(val) {
|
||||
this.selectedRowKeys = val
|
||||
},
|
||||
//批量删除
|
||||
handleMenuClick(data) {
|
||||
if (data.key === "del") {
|
||||
this.$confirm({
|
||||
title: "是否删除选中的信息?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await delAdvice({adviceIds: this.selectedRowKeys})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.selectedRowKeys = [];
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
hasSelected() {
|
||||
return this.selectedRowKeys.length > 0;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.drawer-content {
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,66 @@
|
||||
export const form= {
|
||||
type: 1,
|
||||
name: '',
|
||||
code: '',
|
||||
createStartDate: undefined,
|
||||
createEndDate: undefined,
|
||||
}
|
||||
|
||||
export const addForm = {
|
||||
name: '',
|
||||
imgUrls: [],
|
||||
}
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: "分类编号",
|
||||
width: "18%",
|
||||
dataIndex: "code",
|
||||
},
|
||||
{
|
||||
title: "分类名称",
|
||||
width: "12%",
|
||||
dataIndex: "name",
|
||||
},
|
||||
// {
|
||||
// title: "分类类型",
|
||||
// width: "9%",
|
||||
// dataIndex: "type",
|
||||
// },
|
||||
{
|
||||
title: "添加人名称",
|
||||
width: "15%",
|
||||
dataIndex: "createName",
|
||||
},
|
||||
{
|
||||
title: "设施数量",
|
||||
width: "12%",
|
||||
dataIndex: "num",
|
||||
},
|
||||
{
|
||||
title: "添加时间",
|
||||
width: "16%",
|
||||
dataIndex: "createDate",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "action",
|
||||
key: "action",
|
||||
width: "240",
|
||||
fixed: "right",
|
||||
scopedSlots: { customRender: "action" },
|
||||
},
|
||||
]
|
||||
|
||||
export const rules = {
|
||||
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||
content: [{ required: true, message: "请输入内容", trigger: "blur" }],
|
||||
}
|
||||
|
||||
export function doStr(str, number) {
|
||||
if(str.length >= number) {
|
||||
return str.substr(0,number-1) + '...'
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="cardTitle">
|
||||
<a-space size="large">
|
||||
<!-- <span>{{form.type == 1?'设施管理':'设备管理'}}</span> -->
|
||||
<a-radio-group
|
||||
v-model="form.type"
|
||||
button-style="solid"
|
||||
@change="typeChange"
|
||||
>
|
||||
<a-radio-button :value="1"> 设施管理 </a-radio-button>
|
||||
<a-radio-button :value="2"> 设备管理 </a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-space>
|
||||
</div>
|
||||
<div class="search-box">
|
||||
<a-row>
|
||||
<a-col :span="20">
|
||||
<a-space size="large">
|
||||
<a-input v-model="form.name" style="width: 200px" :placeholder="form.type == 1 ?'设施分类名称':'设备分类名称'"></a-input>
|
||||
<a-input v-model="form.code" style="width: 200px" :placeholder="form.type == 1 ?'设施编号':'设备编号'"></a-input>
|
||||
<a-range-picker @change="handlerTime" v-model="selTime" style="width: 240px" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="['添加开始时间','添加结束时间']"></a-range-picker>
|
||||
<a-button type="primary" @click='getData'>查 询</a-button>
|
||||
<a-button @click='reset'>重 置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<a-button style="margin: 10px" class="add-btn" @click="detailShow = true;mode = 1">添加分类</a-button>
|
||||
<div class="main">
|
||||
<a-table :columns="columns" :data-source="tableData"
|
||||
:pagination="pagination" @change="handlerChange" :scroll="{ x: 1400 }"
|
||||
:row-selection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: selectionChoosed,
|
||||
}"
|
||||
:row-key="
|
||||
(record, index) => {
|
||||
return record.id;
|
||||
}">
|
||||
<template slot="action" slot-scope="text,record">
|
||||
<span><a @click=edit(record)>编辑</a></span>
|
||||
<span><a style="margin-left: 8px;color:red" @click=del(record)>删除</a></span>
|
||||
</template>
|
||||
</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>
|
||||
</div>
|
||||
<a-drawer :title="form.type==1&&mode==1?'添加设施分类':form.type==2&&mode==1?'添加设备分类':form.type==1&&mode==2?'编辑设施分类':'编辑设备分类'"
|
||||
:width="540" :visible="detailShow" :body-style="{ paddingBottom: '60px' }" @close="detailClose">
|
||||
<div class="drawer-content">
|
||||
<a-row>
|
||||
<a-form-model :model="addForm" :rules="rules">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="设施名称" prop="name">
|
||||
<a-input style="width: 300px" placeholder="请输入模版名称" v-model="addForm.name"></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="设施图片">
|
||||
<commonUpload :fileList='fileList' @handleChange="handleChange" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-form-model>
|
||||
</a-row>
|
||||
</div>
|
||||
<div class="drawer-footer" style="float: left">
|
||||
<a-button @click="addConfirm" type="primary" :style="{ marginRight: '8px' }">
|
||||
确认
|
||||
</a-button>
|
||||
<a-button @click="detailClose"> 关闭 </a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getFacilitiesList,addFacility,updateFacility,delFacility,findFacility} from "@/api/operation/facility"
|
||||
import { form ,addForm, rules, columns } from "./depend/config";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:form,
|
||||
columns: columns,
|
||||
rules: rules,
|
||||
tableData: [],
|
||||
selTime: [],
|
||||
pagination: {
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
//新增编辑
|
||||
addForm: addForm,
|
||||
detailShow: false,
|
||||
mode: 1,
|
||||
activeId: undefined,
|
||||
fileList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let obj = Object.assign(this.form, {pageNum:this.pagination.current,size:this.pagination.pageSize})
|
||||
getFacilitiesList(obj).then(res => {
|
||||
this.tableData = res.data.rows;
|
||||
this.pagination.total = res.data.total
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.form.name = ''
|
||||
this.form.code = ''
|
||||
this.form.createStartDate = undefined
|
||||
this.form.createEndDate = undefined
|
||||
this.selTime = []
|
||||
this.getData()
|
||||
},
|
||||
handlerTime(val) {
|
||||
this.form.createStartDate = val[0];
|
||||
this.form.createEndDate = val[1];
|
||||
},
|
||||
typeChange() {
|
||||
this.getData()
|
||||
},
|
||||
handlerChange() {
|
||||
this.pagination.current = val.current;
|
||||
this.pagination.pageSize = val.pageSize;
|
||||
this.getData()
|
||||
},
|
||||
//批量删除
|
||||
selectionChoosed(val) {
|
||||
this.selectedRowKeys = val
|
||||
},
|
||||
handleMenuClick(data) {
|
||||
if (data.key === "del") {
|
||||
this.$confirm({
|
||||
title: "是否删除选中的分类?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await delFacility({facilitiesCategoryIds: this.selectedRowKeys})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.selectedRowKeys = [];
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
del(val) {
|
||||
this.$confirm({
|
||||
title: "是否删除该分类?",
|
||||
icon:'delete',
|
||||
onOk:async()=>{
|
||||
let res = await delFacility({facilitiesCategoryIds: [val.id]})
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
//新增编辑
|
||||
edit(val) {
|
||||
this.mode = 2;
|
||||
findFacility({facilitiesCategoryId: val.id}).then(res => {
|
||||
let data = res.data;
|
||||
this.addForm.name = data.name;
|
||||
if(data.imgList.length>0){
|
||||
const pic = []
|
||||
this.addForm.imgUrls.push(data.imgList[0].url)
|
||||
for(let item of 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
|
||||
}
|
||||
this.activeId = data.id
|
||||
})
|
||||
this.detailShow = true;
|
||||
},
|
||||
addConfirm() {
|
||||
if(this.mode == 1) {
|
||||
let obj = Object.assign(this.addForm,{type: this.form.type})
|
||||
addFacility(obj).then(res => {
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.detailClose()
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
} else if (this.mode == 2) {
|
||||
let obj = Object.assign(this.addForm,{id: this.activeId})
|
||||
updateFacility(obj).then(res => {
|
||||
if(res.code === 200){
|
||||
this.$message.success(res.msg);
|
||||
this.detailClose()
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
detailClose() {
|
||||
this.addForm = {
|
||||
name: '',
|
||||
imgUrls: [],
|
||||
};
|
||||
this.fileList = [];
|
||||
this.detailShow = false;
|
||||
},
|
||||
//图片上传
|
||||
handleChange(data) {
|
||||
this.fileList = data;
|
||||
this.addForm.imgUrls = [];
|
||||
data.forEach(ele => {
|
||||
if(ele.status == 'done') {
|
||||
this.addForm.imgUrls.push(ele.response.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasSelected() {
|
||||
return this.selectedRowKeys.length > 0;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
</style>
|
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue