Ver Fonte

reactor:菜单目录命名调整;外部市民管理新增删除和修改;

zhangchong há 6 meses atrás
pai
commit
01bcc126e0

+ 1 - 1
src/views/auxiliary/eventClass/component/Event-add.vue

@@ -13,7 +13,7 @@
 					</el-form-item>
 				</el-col>
         <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <el-form-item label="事件分类" prop="parentId" :rules="[{ required: true, message: '请选择上级事件', trigger: 'change' }]">
+          <el-form-item label="事件分类" prop="parentId" :rules="[{ required: false, message: '请选择上级事件', trigger: 'change' }]">
             <event-select
                 v-model="state.ruleForm.parentId"
                 v-model:externalArr="state.eventCategoryExternal"

+ 5 - 5
src/views/auxiliary/eventClass/index.vue

@@ -40,7 +40,7 @@
 						v-model:expanded-row-keys="state.expandedRowKeys"
 						:columns="state.columns"
 						:data="state.tableData"
-						expand-column-key="eventFullName"
+						expand-column-key="eventName"
 						fixed
 						:width="width"
 						:height="height"
@@ -189,8 +189,8 @@ const state = reactive<any>({
 			},
 		},
 		{
-			key: 'eventFullName',
-			dataKey: 'eventFullName',
+			key: 'eventName',
+			dataKey: 'eventName',
 			title: '区域名称',
 			width: 600,
 		},
@@ -236,7 +236,7 @@ const formatTable = (list: any[], keyword: string) => {
 	if (!list.length || !Array.isArray(list)) return [];
 	let emptyArr: any[] = [];
 	list.map((item) => {
-		if (item.eventFullName.includes(keyword)) {
+		if (item.eventName.includes(keyword)) {
 			if (item.children && Array.isArray(item.children) && item.children.length > 0) {
 				item.children = formatTable(item.children, keyword);
 			}
@@ -331,7 +331,7 @@ const getNames = (arr: any) => {
 	if (!arr) return [];
 	arr.forEach((v: any) => {
 		if (v.checked) {
-			names.value.push(v.eventFullName);
+			names.value.push(v.eventName);
 		}
 		if (v.children?.length) {
 			getNames(v.children);

+ 11 - 0
src/views/auxiliary/externalCitizen/components/Edit.vue

@@ -0,0 +1,11 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+  
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 56 - 29
src/views/auxiliary/externalCitizen/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="auxiliary-external-citizen-container layout-padding">
-    <div class="layout-padding-auto layout-padding-view pd20">
+		<div class="layout-padding-auto layout-padding-view pd20">
 			<!-- 表格 -->
 			<ProTable
 				ref="proTableRef"
@@ -12,26 +12,26 @@
 				v-model:page-index="state.queryParams.PageIndex"
 				v-model:page-size="state.queryParams.PageSize"
 			>
-        <template #table-search>
-          <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
-            <el-form-item label="市民姓名" prop="Name">
-              <el-input v-model="state.queryParams.Name" placeholder="请填写市民姓名" clearable @keyup.enter="handleQuery" class="keyword-input" />
-            </el-form-item>
-            <el-form-item label="联系电话" prop="PhoneNum">
-              <el-input
-                  v-model="state.queryParams.PhoneNum"
-                  placeholder="请填写市民联系电话"
-                  clearable
-                  @keyup.enter="handleQuery"
-                  class="keyword-input"
-              />
-            </el-form-item>
-            <el-form-item>
-              <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
-              <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
-            </el-form-item>
-          </el-form>
-        </template>
+				<template #table-search>
+					<el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
+						<el-form-item label="市民姓名" prop="Name">
+							<el-input v-model="state.queryParams.Name" placeholder="请填写市民姓名" clearable @keyup.enter="handleQuery" class="keyword-input" />
+						</el-form-item>
+						<el-form-item label="联系电话" prop="PhoneNum">
+							<el-input
+								v-model="state.queryParams.PhoneNum"
+								placeholder="请填写市民联系电话"
+								clearable
+								@keyup.enter="handleQuery"
+								class="keyword-input"
+							/>
+						</el-form-item>
+						<el-form-item>
+							<el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
+							<el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
+						</el-form-item>
+					</el-form>
+				</template>
 				<template #tableHeader="scope">
 					<el-upload
 						v-model:file-list="fileList"
@@ -41,21 +41,25 @@
 						name="file"
 						:http-request="onImport"
 						:show-file-list="false"
-						v-loading="state.loading"
 						class="upload-demo"
+						:disabled="state.loading"
 					>
 						<el-button type="primary" v-auth="'auxiliary:externalCitizen:import'" :loading="state.loading"> <SvgIcon name="ele-Upload" class="mr5" /> 导入市民 </el-button>
 					</el-upload>
 					<el-button type="primary" @click="onDownload" v-auth="'auxiliary:externalCitizen:download'" :loading="state.loading">
 						<SvgIcon name="ele-Download" class="mr5" /> 模板下载
 					</el-button>
+					<el-button type="danger" @click="onDelete" :disabled="!scope.isSelected" :loading="state.loading" v-auth="'auxiliary:externalCitizen:delete'"
+					><SvgIcon name="ele-Delete" class="mr5" />删除
+					</el-button>
+				</template>
+				<template #operation="{ row }">
+					<el-button link type="primary" @click="onEdit(row)" title="编辑市民信息" v-auth="'auxiliary:externalCitizen:edit'"> 修改 </el-button>
 				</template>
 			</ProTable>
 		</div>
-		<!-- 标签记录   -->
-		<tags-record ref="tagsRecordRef" />
-		<!-- 编辑市民画像   -->
-		<tags-edit ref="TagsEditRef" @updateList="queryList" />
+		<!-- 编辑   -->
+		<edit-info ref="editInfoRef" @updateList="queryList" />
 	</div>
 </template>
 
@@ -67,22 +71,23 @@ import { downloadFileByStream } from '@/utils/tools';
 import { formatDate } from '@/utils/formatTime';
 
 // 引入组件
-const TagsRecord = defineAsyncComponent(() => import('@/views/auxiliary/citizen/components/Tags-record.vue')); // 标签记录
-const TagsEdit = defineAsyncComponent(() => import('@/views/auxiliary/citizen/components/Tags-edit.vue')); // 标签编辑
+const EditInfo = defineAsyncComponent(() => import('@/views/auxiliary/externalCitizen/components/Edit.vue')); // 标签编辑
 
 const proTableRef = ref<RefType>(); // 表格ref
 // 表格配置项
 const columns = ref<any[]>([
+	{ type: 'selection', width: 40, align: 'center' },
 	{ prop: 'name', label: '市民姓名' },
 	{ prop: 'phoneNum', label: '联系电话' },
 	{
 		prop: 'creationTime',
 		label: '创建时间',
-    minWidth: 160,
+		minWidth: 160,
 		render: (scope: any) => {
 			return formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS');
 		},
 	},
+	{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 90, align: 'center' },
 ]);
 // 定义变量内容
 const state = reactive({
@@ -163,6 +168,28 @@ const onDownload = () => {
 		})
 		.catch(() => {});
 };
+// 删除
+const onDelete = () => {
+	const ids = proTableRef.value.selectedList.map((item: any) => item.id);
+	ElMessageBox.confirm(`您确定删除选中的${ids.length}条数据,是否继续?`, '提示', {
+		confirmButtonText: '确认',
+		cancelButtonText: '取消',
+		type: 'warning',
+		draggable: true,
+		cancelButtonClass: 'default-button',
+		autofocus: false,
+	})
+		.then(() => {
+			state.loading = true;
+		}).catch(() => {
+		state.loading = false;
+	});
+}
+// 修改
+const editInfoRef = ref<RefType>();
+const onEdit = (row: any) => {
+	editInfoRef.value.openDialog(row);
+};
 // 页面加载时
 onMounted(() => {
 	queryList();