|
@@ -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();
|