WZQ před 1 rokem
rodič
revize
a7f40a23f7

+ 1 - 1
.env.development

@@ -9,7 +9,7 @@ VITE_API_BASEURL = http://127.0.0.1:82
9 9
 
10 10
 
11 11
 # 紫光云
12
-VITE_API_BASEURL = http://172.16.0.37:80/province
12
+VITE_API_BASEURL = http://101.36.160.210:31054/protal
13 13
 # 政务云
14 14
 #VITE_API_BASEURL = http://172.18.93.196:80/province
15 15
 

+ 9 - 0
src/api/home/home.js

@@ -0,0 +1,9 @@
1
+import { baseRequest } from '@/utils/request'
2
+
3
+const request = (url, ...arg) => baseRequest(`/dev/config/` + url, ...arg)
4
+
5
+export default {
6
+	configPage(data) {
7
+		return request('page', data, 'get')
8
+	}
9
+}

+ 158 - 0
src/hook/enumMap.js

@@ -0,0 +1,158 @@
1
+// import { onMounted, ref, onBeforeUnmount, computed, reactive } from 'vue'
2
+import { enumMaplistStore } from '@/store'
3
+
4
+export function enumMap () {
5
+	const StoreDEl = enumMaplistStore()
6
+	const { enumMap, parentMap } = StoreDEl.enumMaplist
7
+	const cocName = (id = '') => {
8
+		const name = enumMap[id]
9
+		return name
10
+	}
11
+	const cocID = (id) => {
12
+		const name = enumMap[id]
13
+		return id
14
+	}
15
+	const getEnumByEnumCode = (enumCode) => {
16
+		for (const key of Object.keys(parentMap)) {
17
+			const arr = parentMap[key]
18
+			for (const enumData of arr) {
19
+				if (enumData.enumid == enumCode) {
20
+					// console.log(enumData)
21
+					if (!enumData.enumname) return console.log('取不到')
22
+					// console.log(enumData.enumname)
23
+					return enumData.enumname
24
+				}
25
+			}
26
+		}
27
+		console.warn('没有找到 enum code', enumCode)
28
+		return null
29
+	}
30
+	const getEnumListByEnumId = (enumId) => {
31
+		return parentMap[enumId]
32
+	}
33
+
34
+	const YES_NO_3 = [
35
+		{ value: '1', label: '能' },
36
+		{ value: '0', label: '否' },
37
+		{ value: '9', label: '其他或不确定' }
38
+	]
39
+
40
+	const cocDEl = (id) => {
41
+		for (const item of YES_NO_3) {
42
+			if (item.value == id) return item.label
43
+		}
44
+	}
45
+
46
+	const LEVEL_TYPE_3 = [
47
+		{ value: '1', label: 'Ⅰ级' },
48
+		{ value: '2', label: 'Ⅱ级' },
49
+		{ value: '3', label: 'Ⅲ级' },
50
+		{ value: '4', label: 'Ⅳ级' }
51
+	]
52
+
53
+	const cocDElⅣ = (id) => {
54
+		for (const item of LEVEL_TYPE_3) {
55
+			if (item.value == id) return item.label
56
+		}
57
+	}
58
+
59
+	const LEVEL_TYPE_5 = [
60
+		{ value: '1', label: 'Ⅰ级' },
61
+		{ value: '2', label: 'Ⅱ级' },
62
+		{ value: '3', label: 'Ⅲ级' },
63
+		{ value: '4', label: '无粮情检测技术' }
64
+	]
65
+
66
+	const cocDElⅣV = (id) => {
67
+		for (const item of LEVEL_TYPE_5) {
68
+			if (item.value == id) return item.label
69
+		}
70
+	}
71
+
72
+	const TFXTXS = [
73
+		{ value: '0', label: '竖向通风' },
74
+		{ value: '1', label: '横向通风' },
75
+		{ value: '2', label: '径向通风' },
76
+		{ value: '3', label: '全网板通风' },
77
+		{ value: '4', label: '其它' }
78
+	]
79
+
80
+	const cocTFXTXS = (id) => {
81
+		for (const item of TFXTXS) {
82
+			if (item.value == id) return item.label
83
+		}
84
+	}
85
+	const DLMXS = [
86
+		{ value: '01', label: '“一字型”挡粮板' },
87
+		{ value: '02', label: '“三角形”挡粮门' },
88
+		{ value: '03', label: '“弧形”挡粮门' },
89
+		{ value: '04', label: '围包' },
90
+		{ value: '05', label: '其它型式' }
91
+	]
92
+	const cocDLMXS = (id) => {
93
+		for (const item of DLMXS) {
94
+			if (item.value == id) return item.label
95
+		}
96
+	}
97
+
98
+	const BUG_INSPECTION_TYPE = [
99
+		{ value: '01', label: '远程检测预警' },
100
+		{ value: '02', label: '人工手动筛查' },
101
+		{ value: '03', label: '其它' }
102
+	]
103
+	const cocBUG_INSPECTION_TYPE = (id) => {
104
+		for (const item of BUG_INSPECTION_TYPE) {
105
+			if (item.value == id) return item.label
106
+		}
107
+	}
108
+
109
+	const GRANARY_STATUS = [
110
+		{ value: '1', label: '完好' },
111
+		{ value: '2', label: '需小修' },
112
+		{ value: '3', label: '需大修' },
113
+		{ value: '4', label: '待报废' },
114
+		{ value: '5', label: '待拆除' },
115
+		{ value: '6', label: '死角仓' },
116
+		{ value: '9', label: '其他' }
117
+	]
118
+
119
+	const cocGRANARY_STATUS = (id) => {
120
+		for (const item of GRANARY_STATUS) {
121
+			if (item.value == id) return item.label
122
+		}
123
+	}
124
+	const PROPERTY_RIGHTS = [
125
+		{ value: '1', label: '自有' },
126
+		{ value: '2', label: '租赁' },
127
+		{ value: '3', label: '共有' },
128
+		{ value: '4', label: '混合' },
129
+		{ value: '9', label: '其他' }
130
+	]
131
+	const cocPROPERTY_RIGHTS = (id) => {
132
+		for (const item of PROPERTY_RIGHTS) {
133
+			if (item.value == id) return item.label
134
+		}
135
+	}
136
+	const YES_NO = [
137
+		{ value: '1', label: '是' },
138
+		{ value: '0', label: '否' }
139
+	]
140
+	const cocYES_NO = (id) => {
141
+		for (const item of YES_NO) {
142
+			if (item.value == id) return item.label
143
+		}
144
+	}
145
+	return {
146
+		cocYES_NO,
147
+		cocPROPERTY_RIGHTS,
148
+		cocName,
149
+		getEnumByEnumCode,
150
+		cocDEl,
151
+		cocDElⅣ,
152
+		cocDElⅣV,
153
+		cocTFXTXS,
154
+		cocDLMXS,
155
+		cocBUG_INSPECTION_TYPE,
156
+		cocGRANARY_STATUS
157
+	}
158
+}

+ 160 - 0
src/hook/listlistPagination.js

@@ -0,0 +1,160 @@
1
+import { onMounted, ref, onBeforeUnmount, computed, reactive } from 'vue'
2
+
3
+export function listPagination(SearchForm, api, delAxios = {}, type = {}, shut = 'shut') {
4
+	if (shut == 'shut') {
5
+		onMounted(() => {
6
+			onSearch()
7
+		})
8
+	}
9
+
10
+	const SearchFormDel = ref(SearchForm)
11
+	const tableData = ref([])
12
+	function onSearch(T) {
13
+		api({ current: 1, size: 5, ...type, ...T }).then((reg) => {
14
+			tableData.value = []
15
+			tableData.value = reg.records || reg
16
+			// Object.assign()
17
+			// Object.assign()
18
+			pagination.total = reg.total || 0
19
+		})
20
+	}
21
+
22
+	const handlePageChange = (current, size) => {
23
+		pagination.current = current
24
+		pagination.pageSize = size
25
+		onSearch({ current: pagination.current, size: pagination.pageSize, ...SearchFormDel.value })
26
+	}
27
+	const pagination = reactive({
28
+		current: 1,
29
+		pageSize: 5,
30
+		total: 0,
31
+		showSizeChanger: true,
32
+		showQuickJumper: true,
33
+		pageSizeOptions: ['5', '10', '30', '40'],
34
+		showTotal: (total, range) => `共 ${total} 条`,
35
+		onChange: handlePageChange
36
+	})
37
+
38
+	const Search = () => {
39
+		pagination.current = 1
40
+		pagination.pageSize = 5
41
+
42
+		onSearch(SearchFormDel.value)
43
+	}
44
+
45
+	function onReset() {
46
+		for (let key in SearchFormDel.value) {
47
+			SearchFormDel.value[key] = ''
48
+		}
49
+		pagination.current = 1
50
+		pagination.pageSize = 5
51
+		onSearch()
52
+	}
53
+	const change = () => {
54
+		onSearch()
55
+	}
56
+	const DEl = async (v) => {
57
+		const res = await delAxios([{ id: v.id }])
58
+		onSearch()
59
+	}
60
+
61
+	return { DEl, change, tableData, onSearch, onReset, handlePageChange, pagination, Search, SearchFormDel }
62
+}
63
+
64
+//
65
+export function listPaginationDEl(SearchForm, api, delAxios = {}, type = {}, shut = 'shut') {
66
+	if (shut == 'shut') {
67
+		onMounted(() => {
68
+			onSearch()
69
+		})
70
+	}
71
+
72
+	const SearchFormDel = ref(SearchForm)
73
+	const tableData = ref([])
74
+	function onSearch(T) {
75
+		api({ current: 1, size: 5, ...type, ...T }).then((reg) => {
76
+			tableData.value = []
77
+			tableData.value = reg.records || res
78
+			// Object.assign()
79
+			// Object.assign()
80
+			pagination.total = reg.total
81
+		})
82
+	}
83
+
84
+	const handlePageChange = (current, size) => {
85
+		pagination.current = current
86
+		pagination.pageSize = size
87
+		onSearch({ current: pagination.current, size: pagination.pageSize, ...SearchFormDel.value })
88
+	}
89
+	const pagination = reactive({
90
+		current: 1,
91
+		pageSize: 5,
92
+		total: 0,
93
+		showSizeChanger: true,
94
+		showQuickJumper: true,
95
+		pageSizeOptions: ['5', '10', '30', '40'],
96
+		showTotal: (total, range) => `共 ${total} 条`,
97
+		onChange: handlePageChange
98
+	})
99
+
100
+	const Search = () => {
101
+		pagination.current = 1
102
+		pagination.pageSize = 5
103
+
104
+		onSearch(SearchFormDel.value)
105
+	}
106
+
107
+	function onReset() {
108
+		for (let key in SearchFormDel.value) {
109
+			SearchFormDel.value[key] = ''
110
+		}
111
+		pagination.current = 1
112
+		pagination.pageSize = 5
113
+		onSearch()
114
+	}
115
+	const change = () => {
116
+		onSearch()
117
+	}
118
+	const DEl = async (v) => {
119
+		const res = await delAxios([{ id: v.id }])
120
+		onSearch()
121
+	}
122
+
123
+	return { DEl, change, tableData, onSearch, onReset, handlePageChange, pagination, Search, SearchFormDel }
124
+}
125
+
126
+export function listPaginationBAQDE(onSearch = {}, SearchForm = {}) {
127
+	const SearchFormDel = ref(SearchForm)
128
+	const handlePageChange = (current, size) => {
129
+		pagination.current = current
130
+		pagination.pageSize = size
131
+		onSearch({ current: pagination.current, size: pagination.pageSize, ...SearchFormDel.value })
132
+	}
133
+	const pagination = reactive({
134
+		current: 1,
135
+		pageSize: 5,
136
+		total: 0,
137
+		showSizeChanger: true,
138
+		showQuickJumper: true,
139
+		pageSizeOptions: ['5', '10', '30', '40'],
140
+		showTotal: (total, range) => `共 ${total} 条`,
141
+		onChange: handlePageChange
142
+	})
143
+
144
+	const Search = () => {
145
+		pagination.current = 1
146
+		pagination.pageSize = 5
147
+
148
+		onSearch(SearchFormDel.value)
149
+	}
150
+
151
+	function onReset() {
152
+		for (let key in SearchFormDel.value) {
153
+			SearchFormDel.value[key] = ''
154
+		}
155
+		pagination.current = 1
156
+		pagination.pageSize = 5
157
+		onSearch()
158
+	}
159
+	return { onReset, handlePageChange, pagination, Search, SearchFormDel }
160
+}

+ 14 - 0
src/hook/onMounted.js

@@ -0,0 +1,14 @@
1
+import { onMounted, ref, onBeforeUnmount, computed, reactive, watch } from 'vue'
2
+
3
+export function onMountedWatch (route, path, onSearch, pagination = {}) {
4
+	watch(
5
+		() => route,
6
+		(newVal) => {
7
+			if (newVal.path == path) {
8
+				onSearch({ current: pagination.current, pageSize: pagination.pageSize })
9
+			}
10
+		},
11
+		{ immediate: true, deep: true }
12
+	)
13
+	return {}
14
+}

+ 198 - 0
src/views/home/carousel/SettingsDel.vue

@@ -0,0 +1,198 @@
1
+<!-- 数据量 -->
2
+<template>
3
+	<div class="pricemoitorrecord">
4
+		<a-card :bordered="false">
5
+			<a-space class="search">
6
+				<div class="silt-title">
7
+					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
8
+						'标题'
9
+					}}</span>
10
+					<a-input style="width: 220px" v-model:value="SearchFormDel.unitName" placeholder="请输入" />
11
+				</div>
12
+				<div class="silt-title">
13
+					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
14
+						'状态'
15
+					}}</span>
16
+
17
+					<a-select style="width: 220px" v-model:value="SearchFormDel.unitName">
18
+						<a-select-option :value="1">禁用</a-select-option>
19
+						<a-select-option :value="2">启用</a-select-option>
20
+					</a-select>
21
+				</div>
22
+				<div class="btnBox">
23
+					<a-button type="primary" class="primarySele" @click="Search"> 查询 </a-button>
24
+					<a-button class="primarySele snowy-buttom-left" @click="onReset"> 重置 </a-button>
25
+					<!-- <a-button type="primary" class="primarySele" @click="onView('add', {})"> 新增 </a-button> -->
26
+					<a-button
27
+						class="btnl colro primarySele"
28
+						type="primary"
29
+						:disabled="!hasSelected"
30
+						:loading="state.loading"
31
+						@click="start"
32
+					>
33
+						批量共享
34
+					</a-button>
35
+					<a-button class="btnl colro" type="primary" :disabled="!hasSelected" :loading="state.loading" @click="start">
36
+						批量禁用
37
+					</a-button>
38
+				</div>
39
+			</a-space>
40
+		</a-card>
41
+
42
+		<div class="list" style="margin-top: 10px">
43
+			<a-table
44
+				:data-source="tableData"
45
+				:pagination="pagination"
46
+				:columns="tableColumns"
47
+				:row-key="(record) => record"
48
+				:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
49
+			>
50
+				<template #bodyCell="{ column, record }">
51
+					<template v-if="column.dataIndex === 'isShare'">
52
+						<div class="switch_del">
53
+							<a-switch
54
+								:checked="record.isShare == '0' ? false : true"
55
+								:checked-children="'是'"
56
+								:un-checked-children="'否'"
57
+								@change="handleSwitchChange(record)"
58
+								size="default"
59
+							/>
60
+						</div>
61
+					</template>
62
+					<template v-if="column.key === '操作'">
63
+						<a-button type="link" @click="onView('view', record)">查看</a-button>
64
+						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
65
+						<a-popconfirm title="确定要删除吗?" @confirm="onView('del', record)">
66
+							<a-button type="link">删除</a-button>
67
+						</a-popconfirm>
68
+					</template>
69
+				</template>
70
+			</a-table>
71
+		</div>
72
+		<Form ref="formRef" @successful="tableRef.refresh()" @change="change" />
73
+	</div>
74
+</template>
75
+<script setup name="sharing">
76
+	import business from '@/api/home/home.js'
77
+	import { listPagination } from '@/hook/listlistPagination.js'
78
+	import { reactive, ref } from 'vue'
79
+	import { useRouter } from 'vue-router'
80
+	import { defineComponent } from 'vue'
81
+	import { message } from 'ant-design-vue'
82
+	import Form from './form.vue'
83
+	const formRef = ref(null)
84
+	const router = useRouter()
85
+
86
+	const tableColumns = [
87
+		// { title: '序号', key: 'INDEX' },
88
+		{
89
+			title: '序号',
90
+			dataIndex: 'INDEX',
91
+			align: 'center',
92
+			customRender: ({ text, record, index }) => {
93
+				return `${index + 1}`
94
+			}
95
+		},
96
+		{ title: '标题', align: 'center', dataIndex: 'unitName' },
97
+		{ title: '来源', align: 'center', dataIndex: 'creditLevel' },
98
+		{ title: '状态', align: 'center', dataIndex: 'assessResult' },
99
+		{ title: '发布人', align: 'center', dataIndex: 'assessResultDepict' },
100
+		{ title: '发布时间', align: 'center', dataIndex: 'isShare' },
101
+		{ title: '操作', align: 'center', key: '操作' }
102
+	]
103
+
104
+	//共享
105
+	const handleSwitchChange = async (v) => {
106
+		// console.log(v)
107
+		if (v.isShare == 1) {
108
+			const res = await {}([{ id: v.id, isShare: 0 }])
109
+		} else {
110
+			const res = await {}([{ id: v.id, isShare: 1 }])
111
+		}
112
+		message.success('操作成功')
113
+		await onSearch()
114
+	}
115
+
116
+	const state = reactive({
117
+		selectedRowKeys: [],
118
+		loading: false
119
+	})
120
+	const hasSelected = computed(() => state.selectedRowKeys.length > 0)
121
+	const start = async () => {
122
+		state.loading = true
123
+		const res = await {}(del.value)
124
+		setTimeout(() => {
125
+			state.loading = false
126
+			message.success('操作成功')
127
+			onSearch()
128
+		}, 300)
129
+	}
130
+	const del = ref([])
131
+	const onSelectChange = (selectedRowKeys) => {
132
+		state.selectedRowKeys = []
133
+		del.value = []
134
+		state.selectedRowKeys = selectedRowKeys
135
+		del.value = state.selectedRowKeys.map((item) => {
136
+			return {
137
+				id: item.id,
138
+				isShare: 1
139
+			}
140
+		})
141
+		console.log(del.value)
142
+	}
143
+
144
+	const { DEl, change, tableData, onSearch, handlePageChange, pagination, Search, onReset, SearchFormDel } =
145
+		listPagination({ unitName: '' }, business.configPage, {}, { isEntAppQuery: 1, sortOrder: 'ASCEND' })
146
+
147
+	setTimeout(() => {
148
+		tableData.value = [{ unitName: '33' }]
149
+	}, 900)
150
+
151
+	// 查看表单数据
152
+	const onView = (record, row) => {
153
+		switch (record) {
154
+			case 'add':
155
+				formRef.value.onOpen(record, true, false)
156
+				break
157
+			case 'del':
158
+				DEl(row)
159
+				break
160
+			case 'view':
161
+				formRef.value.onOpen(record, true, true, row)
162
+				break
163
+			case 'edit':
164
+				formRef.value.onOpen(record, true, false, row)
165
+				break
166
+			default:
167
+				// router.push('/business/personnelDel')
168
+				break
169
+		}
170
+	}
171
+</script>
172
+<style lang="less" scoped>
173
+	.search {
174
+		padding-top: 20px;
175
+		// padding-left: 50px;
176
+		margin-bottom: 32px;
177
+		.btnBox {
178
+			width: 100%;
179
+			display: inline-block;
180
+			display: flex;
181
+			justify-content: space-around;
182
+			align-items: center;
183
+			.primarySele {
184
+				margin-left: 20px;
185
+				margin-right: 20px;
186
+			}
187
+		}
188
+	}
189
+	.silt-title {
190
+		display: flex;
191
+	}
192
+	.switch_del {
193
+		height: 40px;
194
+		display: flex;
195
+		justify-content: center;
196
+		align-items: center;
197
+	}
198
+</style>

+ 252 - 0
src/views/home/carousel/form.vue

@@ -0,0 +1,252 @@
1
+<template>
2
+	<xn-form-container
3
+		:title="'位置信息管理新增'"
4
+		:width="800"
5
+		:visible="visible"
6
+		:destroy-on-close="true"
7
+		@close="onClose"
8
+	>
9
+		<a-form
10
+			:model="formState"
11
+			ref="formStateRef"
12
+			:rules="formStateRules"
13
+			name="basic"
14
+			autocomplete="off"
15
+			@finish="onFinish"
16
+			@finishFailed="onFinishFailed"
17
+		>
18
+			<div class="form">
19
+				<a-row>
20
+					<a-col :span="12">
21
+						<a-form-item class="form-item" label="制度名称" name="systemName" :label-col="{ span: 10 }">
22
+							<a-input
23
+								placeholder="请输入制度名称"
24
+								style="width: 250px"
25
+								:disabled="disabled"
26
+								v-model:value="formState.systemName"
27
+							/>
28
+						</a-form-item>
29
+					</a-col>
30
+					<a-col :span="12">
31
+						<a-form-item class="form-item" label="发布人" name="createUser" :label-col="{ span: 10 }">
32
+							<a-input style="width: 250px" :disabled="true" v-model:value="formState.createUser" />
33
+						</a-form-item>
34
+					</a-col>
35
+				</a-row>
36
+				<a-row>
37
+					<a-col :span="12">
38
+						<a-form-item class="form-item" label="发布时间" name="publishTime" :label-col="{ span: 10 }">
39
+							<a-date-picker
40
+								:disabled="disabled"
41
+								v-model:value="formState.publishTime"
42
+								valueFormat="YYYY-MM-DD HH:mm:ss"
43
+								style="width: 250px"
44
+							/>
45
+						</a-form-item>
46
+					</a-col>
47
+				</a-row>
48
+			</div>
49
+			<div>发布内容</div>
50
+			<div class="input">
51
+				<a-textarea
52
+					placeholder="请输入发布内容"
53
+					v-model:value="formState.publishContent"
54
+					:disabled="disabled"
55
+					allow-clear
56
+				/>
57
+			</div>
58
+
59
+			<a-form-item>
60
+				<div class="item-submit">
61
+					<a-button class="btn1" :disabled="disabled" @click="onClose">取消</a-button>
62
+					<a-button class="btn1" :disabled="disabled" type="primary" html-type="submit">保存</a-button>
63
+				</div>
64
+			</a-form-item>
65
+		</a-form>
66
+		<template #footer>
67
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
68
+		</template>
69
+	</xn-form-container>
70
+</template>
71
+<script lang="js">
72
+	import business from '@/api/home/home.js'
73
+	import { ref } from 'vue'
74
+	import { cloneDeep } from 'lodash-es'
75
+	import { required } from '@/utils/formRules'
76
+	// import global from '@/api/basic.info/global'
77
+
78
+	const disabled = ref(false)
79
+	const visible = ref(false)
80
+	const records = ref('')
81
+	const onOpen = (record, flag, view, row) => {
82
+		records.value = record
83
+		visible.value = flag
84
+		disabled.value = view
85
+		if (row) {
86
+			// detail(row.id)
87
+		}
88
+	}
89
+	const detail = async (v) => {
90
+		const res = await {}({ id: v })
91
+		formState.value = res
92
+		formState.value.attachment = res.attachment.split(',')
93
+		formState.value.createUser = res.createUserName
94
+		console.log(formState.value)
95
+	}
96
+	const onClose = () => {
97
+		visible.value = false
98
+	}
99
+	watch(
100
+		() => visible.value,
101
+		(newVal) => {
102
+			if (!newVal) {
103
+				setTimeout(() => {
104
+					formState.value = {
105
+						systemName: '',
106
+						createUser: JSON.parse(localStorage.getItem('USER_INFO')).name,
107
+						publishTime: '',
108
+						publishContent: '',
109
+						attachment: '',
110
+						id: ''
111
+					}
112
+				}, 0)
113
+			}
114
+		},
115
+		{ immediate: true, deep: true }
116
+	)
117
+
118
+	const formState = ref({
119
+		systemName: '',
120
+		createUser: JSON.parse(localStorage.getItem('USER_INFO')).name,
121
+		publishTime: '',
122
+		publishContent: '',
123
+		attachment: '',
124
+		id: ''
125
+	})
126
+	const formStateRules = ref({
127
+		systemName: [{ required: true, message: '请填写!', trigger: 'blur' }],
128
+		publishTime: [{ required: true, message: '请填写!', trigger: 'change' }],
129
+		attachment: [{ required: true, message: '请填写!', trigger: 'change' }]
130
+	})
131
+	const formStateRef = ref(null)
132
+
133
+	const onFinish = async (values) => {
134
+		formState.value.attachment = values.attachment.join(',')
135
+		await handleAdd(formState.value)
136
+		emit('change')
137
+		formState.value = {
138
+			systemName: '',
139
+			createUser: '',
140
+			publishTime: '',
141
+			publishContent: '',
142
+			attachment: '',
143
+			id: ''
144
+		}
145
+		onClose()
146
+	}
147
+
148
+	const handleAdd = async (val) => {
149
+		if (records.value == 'edit') {
150
+			console.log(records.value)
151
+			const res = await {}(val)
152
+		} else {
153
+			const res = await {}(val)
154
+			console.log('add')
155
+		}
156
+	}
157
+
158
+	const delADD = () => {
159
+		formStateRef.value.validate().then(() => {})
160
+	}
161
+
162
+	const onFinishFailed = (errorInfo) => {
163
+		console.log('Failed:', errorInfo)
164
+	}
165
+
166
+	function changeUpload(fd) {
167
+		return global.uploadFile(fd).then((reg) => {
168
+			uploadDataList.value.clearValidate()
169
+			return reg
170
+		})
171
+	}
172
+	const uploadDataList = ref(null)
173
+	function beforeUpload() {
174
+		uploadDataList.value.clearValidate()
175
+	}
176
+</script>
177
+<style lang="less" scoped>
178
+	.box1 {
179
+		display: flex;
180
+		justify-content: space-between;
181
+		.box-left {
182
+			width: 350px;
183
+			align-items: center;
184
+		}
185
+		.box-right {
186
+			width: 350px;
187
+			margin-right: 10px;
188
+			align-items: center;
189
+		}
190
+	}
191
+	.common {
192
+		display: flex;
193
+		align-items: center;
194
+		justify-content: center;
195
+		margin-bottom: 30px;
196
+		.title {
197
+			width: 130px;
198
+			text-align: right;
199
+			margin-right: 5px;
200
+		}
201
+	}
202
+	.input {
203
+		margin-right: 10px;
204
+		margin-left: 40px;
205
+		margin-top: 20px;
206
+		.ant-input-affix-wrapper {
207
+			height: 100px;
208
+		}
209
+	}
210
+	.btnBox {
211
+		text-align: center;
212
+		margin-top: 100px;
213
+		.snowy-buttom-left {
214
+			margin-left: 100px;
215
+		}
216
+		.acc {
217
+			width: 80px;
218
+			height: 40px;
219
+		}
220
+	}
221
+	.form {
222
+		display: flex;
223
+		flex-wrap: wrap;
224
+		// justify-content: center;
225
+		.form-item {
226
+			width: 250px;
227
+			margin-right: 120px;
228
+		}
229
+	}
230
+	.item-submit {
231
+		display: flex;
232
+		justify-content: center;
233
+		margin-top: 100px;
234
+		.btn1 {
235
+			width: 100px;
236
+			margin-right: 20px;
237
+		}
238
+	}
239
+	.ant-select {
240
+		width: 250px;
241
+	}
242
+	.ant-input {
243
+		width: 250px;
244
+	}
245
+	.ant-form-item-label {
246
+		width: 150px;
247
+	}
248
+	.attachment {
249
+		margin-top: 30px;
250
+		margin-left: 15px;
251
+	}
252
+</style>

+ 195 - 0
src/views/home/carousel/index.vue

@@ -0,0 +1,195 @@
1
+<!-- 数据量 -->
2
+<template>
3
+	<div class="pricemoitorrecord">
4
+		<a-card :bordered="false">
5
+			<a-space class="search">
6
+				<div class="silt-title">
7
+					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
8
+						'标题'
9
+					}}</span>
10
+					<a-input style="width: 220px" v-model:value="SearchFormDel.unitName" placeholder="请输入" />
11
+				</div>
12
+				<div class="silt-title">
13
+					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
14
+						'状态'
15
+					}}</span>
16
+
17
+					<a-select style="width: 220px" v-model:value="SearchFormDel.unitName">
18
+						<a-select-option :value="1">禁用</a-select-option>
19
+						<a-select-option :value="2">启用</a-select-option>
20
+					</a-select>
21
+				</div>
22
+				<div class="btnBox">
23
+					<a-button type="primary" class="primarySele" @click="Search"> 查询 </a-button>
24
+					<a-button class="primarySele snowy-buttom-left" @click="onReset"> 重置 </a-button>
25
+					<!-- <a-button type="primary" class="primarySele" @click="onView('add', {})"> 新增 </a-button> -->
26
+					<a-button
27
+						class="btnl colro primarySele"
28
+						type="primary"
29
+						:disabled="!hasSelected"
30
+						:loading="state.loading"
31
+						@click="start"
32
+					>
33
+						批量共享
34
+					</a-button>
35
+					<a-button class="btnl colro" type="primary" :disabled="!hasSelected" :loading="state.loading" @click="start">
36
+						批量禁用
37
+					</a-button>
38
+				</div>
39
+			</a-space>
40
+		</a-card>
41
+
42
+		<div class="list" style="margin-top: 10px">
43
+			<a-table
44
+				:data-source="tableData"
45
+				:pagination="pagination"
46
+				:columns="tableColumns"
47
+				:row-key="(record) => record"
48
+				:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
49
+			>
50
+				<template #bodyCell="{ column, record }">
51
+					<template v-if="column.dataIndex === 'isShare'">
52
+						<div class="switch_del">
53
+							<a-switch
54
+								:checked="record.isShare == '0' ? false : true"
55
+								:checked-children="'是'"
56
+								:un-checked-children="'否'"
57
+								@change="handleSwitchChange(record)"
58
+								size="default"
59
+							/>
60
+						</div>
61
+					</template>
62
+					<template v-if="column.key === '操作'">
63
+						<a-button type="link" @click="onView('view', record)">查看</a-button>
64
+						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
65
+						<a-popconfirm title="确定要删除吗?" @confirm="onView('del', record)">
66
+							<a-button type="link">删除</a-button>
67
+						</a-popconfirm>
68
+					</template>
69
+				</template>
70
+			</a-table>
71
+		</div>
72
+	</div>
73
+</template>
74
+<script setup name="sharing">
75
+	import business from '@/api/home/home.js'
76
+	import { listPagination } from '@/hook/listlistPagination.js'
77
+	import { reactive, ref } from 'vue'
78
+	import { useRouter } from 'vue-router'
79
+	import { defineComponent } from 'vue'
80
+	import { message } from 'ant-design-vue'
81
+	const formRef = ref(null)
82
+	const router = useRouter()
83
+
84
+	const tableColumns = [
85
+		// { title: '序号', key: 'INDEX' },
86
+		{
87
+			title: '序号',
88
+			dataIndex: 'INDEX',
89
+			align: 'center',
90
+			customRender: ({ text, record, index }) => {
91
+				return `${index + 1}`
92
+			}
93
+		},
94
+		{ title: '标题', align: 'center', dataIndex: 'unitName' },
95
+		{ title: '来源', align: 'center', dataIndex: 'creditLevel' },
96
+		{ title: '状态', align: 'center', dataIndex: 'assessResult' },
97
+		{ title: '发布人', align: 'center', dataIndex: 'assessResultDepict' },
98
+		{ title: '发布时间', align: 'center', dataIndex: 'isShare' },
99
+		{ title: '操作', align: 'center', key: '操作' }
100
+	]
101
+
102
+	//共享
103
+	const handleSwitchChange = async (v) => {
104
+		// console.log(v)
105
+		if (v.isShare == 1) {
106
+			const res = await {}([{ id: v.id, isShare: 0 }])
107
+		} else {
108
+			const res = await {}([{ id: v.id, isShare: 1 }])
109
+		}
110
+		message.success('操作成功')
111
+		await onSearch()
112
+	}
113
+
114
+	const state = reactive({
115
+		selectedRowKeys: [],
116
+		loading: false
117
+	})
118
+	const hasSelected = computed(() => state.selectedRowKeys.length > 0)
119
+	const start = async () => {
120
+		state.loading = true
121
+		const res = await {}(del.value)
122
+		setTimeout(() => {
123
+			state.loading = false
124
+			message.success('操作成功')
125
+			onSearch()
126
+		}, 300)
127
+	}
128
+	const del = ref([])
129
+	const onSelectChange = (selectedRowKeys) => {
130
+		state.selectedRowKeys = []
131
+		del.value = []
132
+		state.selectedRowKeys = selectedRowKeys
133
+		del.value = state.selectedRowKeys.map((item) => {
134
+			return {
135
+				id: item.id,
136
+				isShare: 1
137
+			}
138
+		})
139
+		console.log(del.value)
140
+	}
141
+
142
+	const { DEl, change, tableData, onSearch, handlePageChange, pagination, Search, onReset, SearchFormDel } =
143
+		listPagination({ unitName: '' }, business.configPage, {}, { isEntAppQuery: 1, sortOrder: 'ASCEND' })
144
+
145
+	setTimeout(() => {
146
+		tableData.value = [{ unitName: '33' }]
147
+	}, 900)
148
+	// 查看表单数据
149
+	const onView = (record, row) => {
150
+		switch (record) {
151
+			case 'add':
152
+				router.push('/business/personnelDel?add')
153
+				break
154
+			case 'del':
155
+				DEl(row)
156
+				break
157
+			case 'view':
158
+				router.push(`/verifyQuery/statistical/statisticalDel?code=${true}&id=${row.id}`)
159
+				break
160
+			case 'edit':
161
+				router.push(`/business/personnelDel?code=1&id=${row.id}`)
162
+				break
163
+			default:
164
+				// router.push('/business/personnelDel')
165
+				break
166
+		}
167
+	}
168
+</script>
169
+<style lang="less" scoped>
170
+	.search {
171
+		padding-top: 20px;
172
+		// padding-left: 50px;
173
+		margin-bottom: 32px;
174
+		.btnBox {
175
+			width: 100%;
176
+			display: inline-block;
177
+			display: flex;
178
+			justify-content: space-around;
179
+			align-items: center;
180
+			.primarySele {
181
+				margin-left: 20px;
182
+				margin-right: 20px;
183
+			}
184
+		}
185
+	}
186
+	.silt-title {
187
+		display: flex;
188
+	}
189
+	.switch_del {
190
+		height: 40px;
191
+		display: flex;
192
+		justify-content: center;
193
+		align-items: center;
194
+	}
195
+</style>