2 Commits 8bf951c51d ... 0c662ea5c2

Author SHA1 Message Date
  Liuzhenyu 0c662ea5c2 上传组件优化 1 month ago
  Liuzhenyu 8bf951c51d 上传组件优化 1 month ago

+ 2 - 1
.env.development

@@ -17,7 +17,8 @@ VITE_APP_TOKEN =  6617e72a5a7e41eb6c30aa4fa3000022
 # 开发接口地址
 # VITE_APP_API_URL = "http://libai1024.gnway.cc:80"
 # VITE_APP_API_URL = "http://106.75.213.212:7070"
-VITE_APP_API_URL = "http://192.168.101.73:7070"
+# VITE_APP_API_URL = "http://192.168.101.73:7070"
+VITE_APP_API_URL = "http://172.33.7.60:7070"
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

+ 40 - 7
src/components/components/pageContent.vue

@@ -6,9 +6,18 @@
 							<slot name="button"></slot>
 					</div>
 			</div>
-			<el-table :data="pageList" style="width: 100%; max-height: 55vh; overflow: auto"
-					@selection-change="handleSelectionChange" ref="multipleTableRef" v-bind="props.contentConfig?.tableProps"
-					:row-key="getRowKeys">
+			<el-table
+				:data="pageList"
+				style="width: 100%;
+				max-height: 55vh;
+				overflow: auto"
+				@selection-change="handleSelectionChange"
+				ref="multipleTableRef"
+				v-bind="props.contentConfig?.tableProps"
+				:row-key="getRowKeys"
+				:expand-row-keys="expandedRows"
+      	@expand-change="handleExpandChange"
+				>
 					<!-- v-loading="loading" -->
 					<template v-for="item in contentConfig.propsList">
 							<!-- 序号 -->
@@ -24,9 +33,9 @@
 											<slot :name="item.slotName" v-bind="scope"></slot>
 									</template>
 							</el-table-column>
-							<!--  -->
+							<!-- 展开行 -->
 							<el-table-column type="expand" :fixed="item.fixed" align="center" v-bind="item"
-									v-else-if="item.type === 'expand'">
+									v-else-if="item.type === 'expand'" :label="item.label">
 									<template #default="scope">
 											<slot :name="item.slotName" v-bind="scope"></slot>
 									</template>
@@ -105,7 +114,7 @@ const props = withDefaults(
 			customSubtotal: false,
 	}
 );
-const emit = defineEmits(['handleSelect', 'pageChanged']);
+const emit = defineEmits(['handleSelect', 'pageChanged', 'expandChange']);
 const loading = ref(true);
 
 // 请求数据
@@ -113,6 +122,30 @@ const systemStore = useSystemStore();
 
 const sharedValueStore = useSharedValueStore();
 
+const expandedRows = ref<string[]>([]);
+
+const currentExpandedRow = ref(null)
+
+// 展开行变化时的处理
+const handleExpandChange = (row: any, expanded: boolean) => {
+	if (expanded) {
+    // 如果点击的是当前已展开的行,则关闭它
+    if (currentExpandedRow.value === row.releasedId) {
+      expandedRows.value = []
+      currentExpandedRow.value = null
+    } else {
+      // 否则展开新行
+      expandedRows.value = [row.releasedId]
+      currentExpandedRow.value = row.releasedId
+			emit('expandChange', row)
+    }
+  } else {
+    // 处理手动关闭的情况
+    expandedRows.value = []
+    currentExpandedRow.value = null
+  }
+};
+
 // 获取列表
 async function fetchPageListData(queryInfo: any = {}) {
 	loading.value = true;
@@ -169,7 +202,7 @@ watch(
 const selectedItems = ref([] as any);
 
 const getRowKeys = row => {
-	return row.checkId;
+	return row.releasedId;
 };
 
 // 清空多选

+ 3 - 2
src/views/notificationInfoManage/myPublish/config/content.config.ts

@@ -10,12 +10,13 @@ const contentConfig = {
 		{ type: 'normal', label: '船舶名称', prop: 'chineseVesselName', width: 140 },
 		{ type: 'normal', label: '通报事项类别', prop: 'conmStr', width: 120 },
 		{ type: 'normal', label: '通报事项', prop: 'notificationMatters' },
-		{ type: 'custom', label: '接收单位', slotName: 'names', width: 220 },
+		{ type: 'expand', slotName: 'expand', width: 40},
+		{ type: 'normal', label: '接收单位', prop: 'names', width: 160 },
 		{ type: 'normal', label: '通报状整体状态', prop: 'releaseStatusStr', width: 220 },
 		{ type: 'normal', label: '是否需要反馈', prop: 'wfirStr', width: 220 },
 		{ type: 'normal', label: '发布日期', prop: 'releasedDate', width: 140 },
 		{ type: 'normal', label: '发布人员', prop: 'createBy', width: 140 },
-		{ type: 'handler', label: '操作', slotName: 'operate', width: 180},
+		{ type: 'handler',label: '操作', slotName: 'operate', width: 180, fixed: 'right' },
 	],
 };
 

+ 71 - 3
src/views/notificationInfoManage/myPublish/index.vue

@@ -2,13 +2,62 @@
 	<div class="sensitive-words">
 		<pageSearch ref="searchTableRef" :searchConfig="searchConfig" />
 
-			<pageContent ref="tableListRef" :total="total" :contentConfig="contentConfig" :pageList="tableData">
+			<pageContent
+				ref="tableListRef"
+				:total="total"
+				:contentConfig="contentConfig"
+				:pageList="tableData"
+				@expand-change="handleExpandChange"
+				>
 					<template #button>
 							<el-button type="primary" @click="handleAdd()">新增</el-button>
 							<el-button type="primary" @click="handleExport()">导出</el-button>
 					</template>
+					<template #expand="scope">
+							<div>
+								<div class="flex-ac mb20 mt20">
+									<div class="flex-cc">
+										<div class="square green_bgc" />
+										<div class="green">接收单位正常期限提醒</div>
+									</div>
+									<div class="flex-cc">
+										<div class="square yellow_bgc" />
+										<div class="yellow">接收单位退回和补正超期提醒</div>
+									</div>
+									<div class="flex-cc">
+										<div class="square red_bgc" />
+										<div class="red">接收单位处理/处置完成超期提醒</div>
+									</div>
+								</div>
+								<el-table :data="mattersList" class="mb20">
+									<el-table-column show-overflow-tooltip prop="receivingUnitStr" label="接收单位" />
+									<el-table-column show-overflow-tooltip prop="userPhone" label="联络人电话" width="200" />
+									<el-table-column show-overflow-tooltip prop="notificationStatus" label="通报状态">
+										<template #default="scope">
+											{{ getStatusLabel(notificationStatus, scope.row.notificationStatus) }}
+										</template>
+									</el-table-column>
+									<el-table-column show-overflow-tooltip prop="takeMeasures" label="采取措施">
+										<template #default="scope">
+											{{ getStatusLabel(takeMeasures, scope.row.takeMeasures) }}
+										</template>
+									</el-table-column>
+									<el-table-column show-overflow-tooltip prop="overdueStatus" label="超期状态">
+										<template #default="scope">
+											{{ getStatusLabel(overdueStatus, scope.row.overdueStatus) }}
+										</template>
+									</el-table-column>
+									<el-table-column show-overflow-tooltip prop="acceptanceDate" label="受理日期" />
+									<el-table-column fixed="right" label="操作">
+										<template #default>
+											<el-button link type="primary" size="small" @click="handleDetails(scope.row.releasedId)">查看</el-button>
+										</template>
+									</el-table-column>
+								</el-table>
+							</div>
+					</template>
 					<!-- 接收单位 -->
-					<template #names="scope">
+					<!-- <template #names="scope">
 						<el-popover placement="bottom" width="80%" trigger="click">
 							<template #reference>
 								<div @click="onClickNames(scope.row.releasedId)" class="pointer blue">{{ scope.row.names }}</div>
@@ -55,7 +104,7 @@
 								</el-table>
 							</div>
 						</el-popover>
-					</template>
+					</template> -->
 					<!-- 通报整体状态 -->
 					<!-- <template #releaseStatusStr="scope">
 						{{ getStatusLabel(allNotificationStatus, scope.row.releaseStatusStr) }}
@@ -70,6 +119,21 @@
 							<el-button v-if="scope.row.releasedStatus !== '2'" type="primary" link @click="handleDelete(scope.row.releasedId)">
 									删除
 							</el-button>
+							<!-- <el-button
+								v-if="scope.row.releaseStatusStr === '待发布'"
+								type="primary" 
+								link 
+								@click="handleDetails(scope.row.releasedId)"
+								>
+									发布
+							</el-button> -->
+							<el-button
+								v-if="scope.row.releaseStatusStr === '已发布'"
+								type="primary"
+								link
+								@click="handleDetails(scope.row.releasedId)">
+									撤回
+							</el-button>
 					</template>
 			</pageContent>
 			<router-view></router-view>
@@ -102,6 +166,10 @@ const getNotificationMattersList = async(id) => {
 	mattersList.value = response.data
 }
 
+const handleExpandChange = async (row) => {
+	await getNotificationMattersList(row.releasedId)
+}
+
 const onClickNames = (id) => {
 	getNotificationMattersList(id)
 }

+ 16 - 15
src/views/system/user/index.vue

@@ -130,7 +130,7 @@
                     <el-col :span="12">
                         <el-form-item label="归属部门" prop="deptId">
                             <el-tree-select v-model="form.deptId" :data="deptOptions"
-                                :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id"
+                                :props="{ value: 'strId', label: 'label', children: 'children' }" value-key="strId"
                                 placeholder="请选择归属部门" check-strictly />
                         </el-form-item>
                     </el-col>
@@ -188,11 +188,6 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
-                    <el-col :span="12">
-                        <el-form-item label="工号" prop="jobNumber">
-                            <el-input v-model="form.jobNumber" placeholder="请输入工号" maxlength="30" />
-                        </el-form-item>
-                    </el-col>
                 </el-row>
                 <el-row>
                     <el-col :span="24">
@@ -261,6 +256,7 @@ import { useRouter } from 'vue-router';
 import { ElTree } from 'element-plus';
 import { encrypt } from '@/utils/jsencrypt';
 import axios from 'axios';
+import useDeptStore from '@/store/modules/dept'
 
 const router = useRouter();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -280,7 +276,7 @@ const total = ref(0);
 const title = ref('');
 const dateRange = ref<any>([]);
 const deptName = ref('');
-const deptOptions = ref(undefined);
+const deptOptions = ref<any>(undefined);
 const initPassword = ref(undefined);
 const postOptions = ref<any[]>([]);
 const roleOptions = ref<any[]>([]);
@@ -347,6 +343,8 @@ const data = reactive<{
 
 const { queryParams, form, rules } = toRefs(data);
 
+const deptStore = useDeptStore();
+
 /** 通过条件过滤节点  */
 const filterNode = (value: any, data: any) => {
     if (!value) return true;
@@ -373,7 +371,7 @@ function getList() {
 }
 /** 节点单击事件 */
 function handleNodeClick(data: any) {
-    queryParams.value.deptId = data.id;
+    queryParams.value.deptId = data.strId;
     handleQuery();
 }
 /** 搜索按钮操作 */
@@ -635,20 +633,23 @@ function submitForm() {
                     getList();
                 });
             } else {
-                getKey().then((res: any) => {
-                    let publicKey = res.publicKey;
-                    const password = encrypt(form.value.password, publicKey).toString();
-                    form.value.password = password;
-                    addUser(form.value).then(response => {
+                addUser(form.value).then(response => {
                         proxy!.$modal.msgSuccess('新增成功');
                         open.value = false;
                         getList();
                     });
-                });
             }
         }
     });
 }
 getList();
-getDeptTree();
+// getDeptTree();
+
+onMounted(async () => {
+  // 加载组织架构
+  if (!deptStore.hasDeptData) {
+    await deptStore.loadDeptDataFromCache();
+  }
+  deptOptions.value = deptStore.deptData;
+  })
 </script>