first commit

main
“yyffkk” 2 years ago
parent 49b2291f0f
commit d0cbc441f0

@ -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/'

@ -11,12 +11,14 @@
"axios": "^0.24.0",
"core-js": "^3.6.5",
"echarts": "^5.3.2",
"element-ui": "^2.15.12",
"less": "^4.1.2",
"less-loader": "5.0.0",
"momen": "^0.0.1-security",
"nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2",
"vue": "^2.6.11",
"vue-json-excel": "^0.3.0",
"vue-router": "^3.5.3",
"vuescroll": "^4.17.3",
"vuex": "^3.6.2"

@ -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,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,9 @@
const requestUrl = {
// 综合服务
userProtectionRegistrationList:'user/protectionRegistration/list',
userReturnRegistrationList:'user/registration/list',
userEpidemicClockOnList:'user/epidemicClockOn/list'
}
export default requestUrl

@ -15,6 +15,7 @@ Vue.use(mixins);
// Vue.use(Cascader);
import store from "@/store";
import router from "@/permission";
import JsonExcel from 'vue-json-excel'
// Vue.prototype.$moment = moment
const communityCode = store.getters.getCommunityCode;
@ -32,6 +33,7 @@ Vue.component('commonUpload', commonUpload)
Vue.component('allCity', allCity)
Vue.component('searchForm', searchForm)
Vue.component('alarmModal', alarmModal)
Vue.component('downloadExcel', JsonExcel)
new Vue({
render: h => h(App),

@ -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
}

@ -108,6 +108,11 @@ const router = [
name: "Login",
title: "登录",
component: resolve => require(['@/views/Login'], resolve)
},
{
path:'/videoFusion',
name:'videoFusion',
component: resolve => require(['@/views/Operation/Epidemic/videoFusion.vue'], resolve),
}
]

@ -216,6 +216,43 @@ export default [
component: resolve => require(['@/views/Operation/CommunityIntro'], resolve),
meta: {title: '社区介绍'},
},
{
path: '/Epidemic',
name: "Epidemic",
title: "新冠疫情防控",
icon: 'solution',
hide: false,
component: resolve => require(['@/views/Operation/Epidemic'], resolve),
redirect: '/Facility/FacilityType',
meta: {title: '设施设备'},
children: [
{
path: '/Epidemic/EpidemicRegister',
name: "EpidemicRegister",
title: "新冠防护登记",
hide: false,
component: resolve => require(['@/views/Operation/Epidemic/_epidemicRegister'], resolve),
meta: {title: '设施设备分类'},
},
{
path: '/Epidemic/EpidemicClockOn',
name: "EpidemicClockOn",
title: "新冠健康打卡",
hide: false,
component: resolve => require(['@/views/Operation/Epidemic/_epidemicClockOn'], resolve),
meta: {title: '设施设备管理'},
},
{
path: '/Epidemic/EpidemicReturnRegister',
name: "FacilityPreOrder",
title: "新冠返程登记",
hide: false,
component: resolve => require(['@/views/Operation/Epidemic/_epidemicReturnRegister'], resolve),
meta: {title: '预约管理'},
},
]
},
{
path: '/Facility',
name: "Facility",

@ -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,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,200 @@
<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
>
<div style="margin-left: 16px">
<!-- :before-generate="startDownload"
:before-finish="finishDownload" -->
<download-excel
class="export-excel-wrapper"
:fetch="fetchData"
:fields="json_fields"
:before-finish="finishDownload"
name="收费标准.xls"
>
<!-- 上面可以自定义自己的样式还可以引用其他组件button -->
<el-button
type="init-button2"
icon="el-icon-folder-add"
plain
>导出Excel</el-button
>
</download-excel>
</div>
<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 class="ant-dropdown-link" @click="del([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 {DownloadExcel} from '@/plugins/DownloadExcel';
import {epidemicClockOnDelete,getClockOnList} from "@/api/operation/epidemic/index.js";
import { topicList} 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: {
comprehensiveSearchNumber: undefined,
comprehensiveSearch: undefined,
residentialHousing: undefined,
startTime: undefined,
endTime: undefined,
typeOfAccess: undefined,
reasonForEntryAndExit: undefined
},
formItem,
columns,
pagination,
// index
selectedRowKeys: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData() {
let res = await getClockOnList({
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 epidemicClockOnDelete({ epidemicClockOnIds: 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,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,245 @@
<template>
<div>
<div class="cardTitle">新冠防护登记</div>
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="jumpTo"
>下载登记二维码</a-button
>
<div style="margin-left: 16px">
<!-- :before-generate="startDownload"
:before-finish="finishDownload" -->
<download-excel
class="export-excel-wrapper"
:fetch="fetchData"
:fields="json_fields"
:before-finish="finishDownload"
name="收费标准.xls"
>
<!-- 上面可以自定义自己的样式还可以引用其他组件button -->
<a-button
type="init-button2"
icon="el-icon-folder-add"
plain
>导出Excel</a-button
>
</download-excel>
</div>
<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 class="ant-dropdown-link" @click="del([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 {DownloadExcel} from '@/plugins/DownloadExcel'
import {getRegistersList,protectionRegistrationDelete,registerExport} 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: {
comprehensiveSearchNumber: undefined,
comprehensiveSearch: undefined,
residentialHousing: undefined,
startTime: undefined,
endTime: undefined,
typeOfAccess: undefined,
reasonForEntryAndExit: undefined
},
formItem,
columns,
pagination,
// index
selectedRowKeys: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData() {
let res = await getRegistersList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
console.log(res)
},
search(data){
this.searchForm = data;
this.getData()
},
edit(id) {
this.editId = id;
this.drawer.show = true;
},
del(ids) {
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async () => {
console.log(ids);
let res = await protectionRegistrationDelete({ protectionRegistrationIds : ids });
console.log(res);
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
async exportData(){
let res = await registerExport({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
console.log(res)
},
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();
},
jumpTo(){
this.$router.replace('/videoFusion')
},
async fetchData() {
let Excel = []
let params = {
url: 'userProtectionRegistrationList',
data: {
pageNum: 1,
size: 100
}
}
const data = await DownloadExcel(params, this)
return data
},
// Excel
ExcelLoading(page, pageCount) {
const Loading = this.$loading({
lock: true,
text: `正在导出Excel${page}`,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
Loading.text = `正在导出Excel ${page}/${pageCount}`
console.log(Loading.text)
},
// Excel
finishDownload() {
const Loading = this.$loading()
Loading.close()
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
.table-img {
width: 40px;
height: 40px;
}
</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>

16030
yarn.lock

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