浏览代码

修改app表单

ZaiZai 2 年之前
父节点
当前提交
a6837821bf

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20230725182648"
+  "value": "20230810103606"
 }

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "20230607160059",
-    "target": "http://47.110.251.215:8090",
+    "target": "http://192.168.0.109:8090",
     "smsPhone": "",
     "vite": {
         "port": 5174,

+ 2 - 4
src/router/index.js

@@ -14,10 +14,8 @@ const router = vueRouter.createRouter({
 //路由拦截
 router.beforeResolve(async (to) => {
     NProgress.start()
-    const token = getToken()
-    if (to.path === '/login') {
-        return true
-    } else if (to.path === '/auth' || to.path === '/app-auth') {
+    const token = getToken(), auth = ['/login', '/auth', '/app/table-form']
+    if (auth.indexOf(to.path) !== -1) {
         return true
     } else if (!token) {
         return '/login'

+ 4 - 10
src/router/modules/base.js

@@ -19,10 +19,10 @@ export default [
         component: () => import('~src/views/user/auth.vue'),
     },
     {
-        path: '/app-auth',
-        name: 'app-auth',
-        meta: { title: '授权入口' },
-        component: () => import('~src/views/login/auth.vue'),
+        path: '/app/table-form',
+        name: 'app-table-form',
+        meta: { title: 'APP填报表单' },
+        component: () => import('~src/views/uni-app/table-form.vue'),
     },
     {
         path: '/home',
@@ -417,12 +417,6 @@ export default [
             },
         ],
     },
-    {
-        path: '/uni-app/table-form',
-        name: 'app-table-form',
-        meta: { title: 'app表单' },
-        component: () => import('~src/views/uni-app/table-form.vue'),
-    },
     {
         path: '/403',
         name: '403',

+ 0 - 3
src/router/modules/token.js

@@ -12,7 +12,4 @@ export default [
     'user-index',
     'test-index',
     'tentative-detect-test-form',
-
-    //uni-app
-    'app-table-form',
 ]

+ 0 - 73
src/views/login/auth.vue

@@ -1,73 +0,0 @@
-<template>
-    <div v-loading="loading" class="hc-body-loading" element-loading-text="授权登录中...">
-        <div v-if="isErrorShow" class="error-page">
-            <div class="img" :style="`background-image: url(${svg403});`" />
-            <div class="content">
-                <h1>401</h1>
-                <div class="desc">
-                    抱歉,身份验证异常,请重新进入
-                </div>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { onMounted, ref } from 'vue'
-import { useAppStore } from '~src/store'
-import { useAppLogin } from '~sto/user'
-import { useRoute, useRouter } from 'vue-router'
-import svg403 from '~src/assets/view/403.svg'
-import { isNullES } from 'js-fast-way'
-
-//初始变量
-const router = useRouter()
-const useRoutes = useRoute()
-const useAppState = useAppStore()
-
-//变量
-const loading = ref(true)
-const isErrorShow = ref(false)
-
-//渲染完成
-onMounted(() => {
-    const { user, source } = useRoutes.query
-    if (!isNullES(user)) {
-        const userInfo = JSON.parse(decodeURIComponent(user))
-        useAppState.setIsSource(source)
-        useAppLoginApi(userInfo)
-    } else {
-        loading.value = false
-        isErrorShow.value = true
-    }
-})
-
-//请求授权登录
-const useAppLoginApi = async (form) => {
-    loading.value = true
-    const { error, status } = await useAppLogin(form)
-    if (!error && status === 200) {
-        //设置主题
-        useAppState.setTheme('light')
-        useAppState.setThemeVal('light')
-        //处理其他数据
-        const { url, node } = useRoutes.query
-        if (!isNullES(url)) {
-            router.push({
-                name: url,
-                query: node ? JSON.parse(decodeURIComponent(node)) : {},
-            }).then()
-        }
-        loading.value = false
-        isErrorShow.value = false
-    } else {
-        window.$message?.error('身份验证异常')
-        isErrorShow.value = true
-        loading.value = false
-    }
-}
-</script>
-
-<style lang="scss" scoped>
-@import "../../styles/error/app-auth.scss";
-</style>

+ 174 - 0
src/views/uni-app/components/data-form.vue

@@ -0,0 +1,174 @@
+<template>
+    <div v-loading="loading" class="hc-uni-app-table-form" :class="[editType]">
+        <hc-table-form ref="tableFormRef" :form="tableFormInfo" :html="excelHtml" :scroll="false" :pkey="appItem.pkeyId" @render="tableFormRender" />
+    </div>
+</template>
+
+<script setup>
+import { onMounted, ref, watch } from 'vue'
+import wbsApi from '~api/data-fill/wbs'
+import { useAppStore } from '~src/store'
+import { getObjVal, getObjValue, isString } from 'js-fast-way'
+
+const props = defineProps({
+    option: {
+        type: Object,
+        default: () => ({}),
+    },
+})
+
+//初始变量
+const useAppState = useAppStore()
+
+//基础变量
+const appItem = ref(props.option)
+const tableFormRef = ref(null)
+const editType = ref('form')
+const loading = ref(false)
+
+//深度监听
+watch(() => [
+    props.option,
+], ([option]) => {
+    appItem.value = getObjValue(option)
+    getInitData()
+}, { deep: true })
+
+//渲染完成
+onMounted(() => {
+    //设置主题
+    useAppState.setTheme('light')
+    useAppState.setThemeVal('light')
+    if (getObjVal(appItem.value)) {
+        getInitData()
+    }
+    //接受app传递过来的消息
+    window.addEventListener('message', (event) => {
+        const { source, data, type } = event.data
+        if (source === 'app') {
+            if (type === 'editTypeClick') {
+                editTypeClick(data)
+            } else if (type === 'formSave') {
+                toSaveClick()
+            }
+        }
+    })
+})
+
+const getInitData = () => {
+    //获取相关数据
+    getWbsContractById()
+    getDataApi()
+    editTypeClick('form')
+}
+
+const getDataApi = async () => {
+    if (appItem.value.pkeyId) {
+        loading.value = true
+        await getTableFormInfo()
+        await getExcelHtml()
+        loading.value = false
+    }
+}
+
+//获取详情
+const wbsInfo = ref({})
+const getWbsContractById = async () => {
+    const { data } = await wbsApi.getWbsContractById({
+        pKeyId: appItem.value.pkeyId,
+    })
+    wbsInfo.value = getObjValue(data)
+}
+
+//获取表单初始数据
+const getFormDataInit = (data = {}) => {
+    const { projectId, contractId, classify, treeId, pkeyId } = appItem.value
+    return {
+        projectId: projectId,
+        contractId: contractId,
+        classify: classify,
+        pkeyId: pkeyId,
+        nodeId: treeId,
+        isRenderForm: false,
+        ...data,
+    }
+}
+
+//获取已填写的数据
+const tableFormInfo = ref({})
+const getTableFormInfo = async () => {
+    const { error, code, data } = await wbsApi.getBussDataInfo({
+        pkeyId: appItem.value.pkeyId,
+    }, false)
+    const resData = getObjVal(data)
+    if (!error && code === 200 && resData) {
+        tableFormInfo.value = getFormDataInit(resData)
+    } else {
+        tableFormInfo.value = getFormDataInit()
+    }
+}
+
+//获取模板标签数据
+const excelHtml = ref('')
+const getExcelHtml = async () => {
+    const { error, code, data } = await wbsApi.getExcelHtml({
+        pkeyId: appItem.value.pkeyId,
+    }, false)
+    const resData = isString(data) ? data || '' : ''
+    if (!error && code === 200 && resData) {
+        excelHtml.value = resData
+    } else {
+        excelHtml.value = ''
+        tableFormInfo.value.isRenderForm = false
+        window?.$message?.warning('暂无表单')
+    }
+}
+
+//渲染完成
+const tableFormRender = (form) => {
+    tableFormInfo.value = form
+}
+
+
+//切换显示模式
+const tableWidth = ref(0)
+const editTypeClick = (type) => {
+    let metaEle = document.getElementsByName('viewport')[0]
+    if (type === 'form') {
+        metaEle.setAttribute('content', 'width=device-width,user-scalable=no,initial-scale=1.0')
+        tableWidth.value = 0
+    } else if (type === 'table') {
+        metaEle.setAttribute('content', 'width=1080, initial-scale=0.5,user-scalable=yes')
+        tableWidth.value = document.body.offsetWidth
+    }
+    editType.value = type
+}
+
+//保存表单
+const toSaveClick = async () => {
+    const { pkeyId, status } = appItem.value
+    if (!pkeyId) {
+        window?.$message?.warning('pkeyId为空')
+        return
+    } else if (status === '3') {
+        window?.$message?.warning('已上报的资料,不允许保存。')
+        return
+    }
+    const formData = tableFormRef.value?.getFormData()
+    const { error, code, msg } = await wbsApi.saveExcelBussData(formData, false)
+    if (!error && code === 200) {
+        window?.$message?.success('保存成功')
+        window?.postMessage({
+            type: 'saveSuccess',
+            source: 'web',
+            data: {},
+        })
+    } else {
+        window?.$message?.error(msg)
+    }
+}
+</script>
+
+<style lang="scss">
+@import "~src/styles/uni-app/table-form.scss";
+</style>

+ 55 - 127
src/views/uni-app/table-form.vue

@@ -1,155 +1,83 @@
 <template>
-    <div v-loading="loading" class="hc-uni-app-table-form" :class="[editType]">
-        <hc-table-form ref="tableFormRef" :form="tableFormInfo" :html="excelHtml" :scroll="false" :pkey="appItem.pkeyId" @render="tableFormRender" />
+    <div v-if="isType === ''" v-loading="loading" class="hc-body-loading" element-loading-text="授权登录中...">
+        <div v-if="isErrorShow" class="error-page">
+            <div class="img" :style="`background-image: url(${svg403});`" />
+            <div class="content">
+                <h1>401</h1>
+                <div class="desc">抱歉,身份验证异常,请重新进入</div>
+            </div>
+        </div>
     </div>
+    <HcDataForm v-if="isType === 'data-fill'" :option="formNode" />
 </template>
 
 <script setup>
 import { onMounted, ref } from 'vue'
-import { useRoute } from 'vue-router'
-import wbsApi from '~api/data-fill/wbs'
 import { useAppStore } from '~src/store'
-import { getObjVal, getObjValue, isString } from 'js-fast-way'
+import { useAppLogin } from '~sto/user'
+import { useRoute } from 'vue-router'
+import svg403 from '~src/assets/view/403.svg'
+import { isNullES } from 'js-fast-way'
+import HcDataForm from './components/data-form.vue'
 
 //初始变量
 const useRoutes = useRoute()
-const appItem = useRoutes.query
 const useAppState = useAppStore()
 
-//基础变量
-const tableFormRef = ref(null)
-const editType = ref('form')
-const loading = ref(false)
+//变量
+const loading = ref(true)
+const isErrorShow = ref(false)
+const isType = ref('')
+const formNode = ref({})
 
 //渲染完成
 onMounted(() => {
-    //设置主题
-    useAppState.setTheme('light')
-    useAppState.setThemeVal('light')
-    //获取相关数据
-    getWbsContractById()
-    getDataApi()
-    editTypeClick('form')
-    //接受app传递过来的消息
-    window.addEventListener('message', (event) => {
-        const { source, data, type } = event.data
-        if (source === 'app') {
-            if (type === 'editTypeClick') {
-                editTypeClick(data)
-            } else if (type === 'formSave') {
-                toSaveClick()
-            }
-        }
-    })
-})
-
-const getDataApi = async () => {
-    if (appItem.pkeyId) {
-        loading.value = true
-        await getTableFormInfo()
-        await getExcelHtml()
-        loading.value = false
-    }
-}
-
-//获取详情
-const wbsInfo = ref({})
-const getWbsContractById = async () => {
-    const { data } = await wbsApi.getWbsContractById({
-        pKeyId: appItem.pkeyId,
-    })
-    wbsInfo.value = getObjValue(data)
-}
-
-//获取表单初始数据
-const getFormDataInit = (data = {}) => {
-    const { projectId, contractId, classify, treeId, pkeyId } = appItem
-    return {
-        projectId: projectId,
-        contractId: contractId,
-        classify: classify,
-        pkeyId: pkeyId,
-        nodeId: treeId,
-        isRenderForm: false,
-        ...data,
-    }
-}
-
-//获取已填写的数据
-const tableFormInfo = ref({})
-const getTableFormInfo = async () => {
-    const { error, code, data } = await wbsApi.getBussDataInfo({
-        pkeyId: appItem.pkeyId,
-    }, false)
-    const resData = getObjVal(data)
-    if (!error && code === 200 && resData) {
-        tableFormInfo.value = getFormDataInit(resData)
+    const { user, source } = useRoutes.query
+    if (!isNullES(user)) {
+        const userInfo = JSON.parse(decodeURIComponent(user))
+        useAppState.setIsSource(source)
+        useAppLoginApi(userInfo)
     } else {
-        tableFormInfo.value = getFormDataInit()
+        loading.value = false
+        isErrorShow.value = true
     }
-}
+})
 
-//获取模板标签数据
-const excelHtml = ref('')
-const getExcelHtml = async () => {
-    const { error, code, data } = await wbsApi.getExcelHtml({
-        pkeyId: appItem.pkeyId,
-    }, false)
-    const resData = isString(data) ? data || '' : ''
-    if (!error && code === 200 && resData) {
-        excelHtml.value = resData
+//请求授权登录
+const useAppLoginApi = async (form) => {
+    loading.value = true
+    const { error, status } = await useAppLogin(form)
+    if (!error && status === 200) {
+        //设置主题
+        useAppState.setTheme('light')
+        useAppState.setThemeVal('light')
+        //处理其他数据
+        setTimeout(() => {
+            setFormType()
+        }, 1000)
+        loading.value = false
+        isErrorShow.value = false
     } else {
-        excelHtml.value = ''
-        tableFormInfo.value.isRenderForm = false
-        window?.$message?.warning('暂无表单')
-    }
-}
-
-//渲染完成
-const tableFormRender = (form) => {
-    tableFormInfo.value = form
-}
-
-
-//切换显示模式
-const tableWidth = ref(0)
-const editTypeClick = (type) => {
-    let metaEle = document.getElementsByName('viewport')[0]
-    if (type === 'form') {
-        metaEle.setAttribute('content', 'width=device-width,user-scalable=no,initial-scale=1.0')
-        tableWidth.value = 0
-    } else if (type === 'table') {
-        metaEle.setAttribute('content', 'width=1080, initial-scale=0.5,user-scalable=yes')
-        tableWidth.value = document.body.offsetWidth
+        window.$message?.error('身份验证异常')
+        isErrorShow.value = true
+        loading.value = false
     }
-    editType.value = type
 }
 
-//保存表单
-const toSaveClick = async () => {
-    const { pkeyId, status } = appItem
-    if (!pkeyId) {
-        window?.$message?.warning('pkeyId为空')
-        return
-    } else if (status === '3') {
-        window?.$message?.warning('已上报的资料,不允许保存。')
+const setFormType = () => {
+    const { type, node } = useRoutes.query
+    if (isNullES(type)) {
+        window.$message?.error('身份验证异常')
+        isErrorShow.value = true
+        loading.value = false
         return
     }
-    const formData = tableFormRef.value?.getFormData()
-    const { error, code, msg } = await wbsApi.saveExcelBussData(formData, false)
-    if (!error && code === 200) {
-        window?.$message?.success('保存成功')
-        window?.postMessage({
-            type: 'saveSuccess',
-            source: 'web',
-            data: {},
-        })
-    } else {
-        window?.$message?.error(msg)
-    }
+    //处理其他数据
+    formNode.value = node ? JSON.parse(decodeURIComponent(node)) : {}
+    isType.value = type
 }
 </script>
 
-<style lang="scss">
-@import "~src/styles/uni-app/table-form.scss";
+<style lang="scss" scoped>
+@import "../../styles/error/app-auth.scss";
 </style>

+ 199 - 158
src/views/user/index.vue

@@ -3,72 +3,86 @@
         <div class="hc-layout-left-box">
             <div class="user-avatar-box">
                 <div v-loading="avatarLoading" class="user-avatar">
-                    <img :src="userInfo['avatar'] || avatarPng" alt="" crossOrigin="anonymous"/>
+                    <img :src="userInfo.avatar || avatarPng" alt="" crossOrigin="anonymous">
                     <div class="user-avatar-upload">
-                        <el-upload :accept="accept" :action="action" :before-upload="beforeUpload" :data="upData"
-                                   :headers="getTokenHeader()" :on-error="uploadError" :on-success="uploadFinish"
-                                   :show-file-list="false" class="upload-dom">
-                            <HcIcon fill name="camera"/>
+                        <el-upload
+                            :accept="accept" :action="action" :before-upload="beforeUpload" :data="upData"
+                            :headers="getTokenHeader()" :on-error="uploadError" :on-success="uploadFinish"
+                            :show-file-list="false" class="upload-dom"
+                        >
+                            <HcIcon fill name="camera" />
                         </el-upload>
                     </div>
                 </div>
-                <div class="user-name truncate">{{ userInfo['real_name'] || '游客' }}</div>
+                <div class="user-name truncate">{{ userInfo.real_name || '游客' }}</div>
             </div>
             <div class="user-menu-box">
                 <el-scrollbar>
-                    <HcMenuSimple :datas="menuOptions" :keys="menuKey" @change="handleMenuValue"/>
+                    <HcMenuSimple :datas="menuOptions" :keys="menuKey" @change="handleMenuValue" />
                 </el-scrollbar>
             </div>
         </div>
         <div class="hc-layout-content-box">
-            <HcCard v-if="menuKey !== 'log' && menuKey !== 'recycle'" :title="menuItem.label" :ui="basicHight?'basic-hight':''"
-                    scrollbar>
+            <HcCard
+                v-if="menuKey !== 'log' && menuKey !== 'recycle'" :title="menuItem.label" :ui="basicHight ? 'basic-hight' : ''"
+                scrollbar
+            >
                 <template #extra>
-                    <span v-if="menuKey === 'basic' && !basicFormEdit" class="text-link"
-                          @click="basicFormEditClick">编辑</span>
-                    <span v-if="menuKey === 'project'" class="text-link"
-                          @click="setDefaultProjectClick">设置默认项目</span>
+                    <span
+                        v-if="menuKey === 'basic' && !basicFormEdit" class="text-link"
+                        @click="basicFormEditClick"
+                    >编辑</span>
+                    <span
+                        v-if="menuKey === 'project'" class="text-link"
+                        @click="setDefaultProjectClick"
+                    >设置默认项目</span>
                 </template>
                 <template v-if="menuKey === 'basic'">
-                    <el-form ref="formUserRef" :model="formUserModel" :rules="formUserRules" label-position="top"
-                             size="large">
+                    <el-form
+                        ref="formUserRef" :model="formUserModel" :rules="formUserRules" label-position="top"
+                        size="large"
+                    >
                         <el-row :gutter="20">
                             <el-col :span="12">
                                 <el-form-item label="用户名称">
-                                    <el-input v-model="formUserModel.real_name" disabled/>
+                                    <el-input v-model="formUserModel.real_name" disabled />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
                                 <el-form-item label="登录账号">
-                                    <el-input v-model="formUserModel.account" disabled placeholder=""/>
+                                    <el-input v-model="formUserModel.account" disabled placeholder="" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
                                 <el-form-item label="身份证号">
-                                    <el-input v-model="formUserModel.idNumber" disabled placeholder=""/>
+                                    <el-input v-model="formUserModel.idNumber" disabled placeholder="" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
-                                <el-form-item :prop="basicFormEdit?'phone':''" label="绑定手机">
-                                    <el-input v-model="formUserModel.phone" :disabled="!basicHight"
-                                              placeholder="请输入绑定手机"/>
+                                <el-form-item :prop="basicFormEdit ? 'phone' : ''" label="绑定手机">
+                                    <el-input
+                                        v-model="formUserModel.phone" :disabled="!basicHight"
+                                        placeholder="请输入绑定手机"
+                                    />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
                                 <el-form-item label="所属角色">
-                                    <el-input v-model="formUserModel.roleName" disabled placeholder=""/>
+                                    <el-input v-model="formUserModel.roleName" disabled placeholder="" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
                                 <el-form-item label="所属部门">
-                                    <el-input v-model="formUserModel.deptId" disabled placeholder=""/>
+                                    <el-input v-model="formUserModel.deptId" disabled placeholder="" />
                                 </el-form-item>
                             </el-col>
                             <el-col :span="12">
                                 <el-form-item label="CA签字体">
-                                    <el-image v-if="formUserModel?.signatureUrl" :initial-index="0"
-                                              :preview-src-list="[formUserModel?.signatureUrl]" :src="formUserModel?.signatureUrl"
-                                              fit="cover" style="height: 60px"/>
+                                    <el-image
+                                        v-if="formUserModel?.signatureUrl" :initial-index="0"
+                                        :preview-src-list="[formUserModel?.signatureUrl]" :src="formUserModel?.signatureUrl"
+                                        fit="cover" style="height: 60px"
+                                    />
                                     <span v-else class="text-zinc-400">无CA签字体</span>
                                 </el-form-item>
                             </el-col>
@@ -76,19 +90,27 @@
                     </el-form>
                 </template>
                 <template v-if="menuKey === 'password'">
-                    <el-form ref="formUserPassRef" :model="formUserPassModel" :rules="formUserPassRules" label-position="top"
-                             size="large" style="max-width: 400px; margin: auto;">
+                    <el-form
+                        ref="formUserPassRef" :model="formUserPassModel" :rules="formUserPassRules" label-position="top"
+                        size="large" style="max-width: 400px; margin: auto;"
+                    >
                         <el-form-item label="原始密码" prop="oldPassword">
-                            <el-input v-model="formUserPassModel.oldPassword" placeholder="请输入原始密码"
-                                      show-password type="password"/>
+                            <el-input
+                                v-model="formUserPassModel.oldPassword" placeholder="请输入原始密码"
+                                show-password type="password"
+                            />
                         </el-form-item>
                         <el-form-item label="新的密码" prop="newPassword">
-                            <el-input v-model="formUserPassModel.newPassword" placeholder="请输入新的密码"
-                                      show-password type="password"/>
+                            <el-input
+                                v-model="formUserPassModel.newPassword" placeholder="请输入新的密码"
+                                show-password type="password"
+                            />
                         </el-form-item>
                         <el-form-item label="确认新密码" prop="newPassword1">
-                            <el-input v-model="formUserPassModel.newPassword1" placeholder="请输入确认新密码"
-                                      show-password type="password"/>
+                            <el-input
+                                v-model="formUserPassModel.newPassword1" placeholder="请输入确认新密码"
+                                show-password type="password"
+                            />
                         </el-form-item>
                     </el-form>
                 </template>
@@ -96,12 +118,14 @@
                     <el-menu :default-active="projectKey" class="hc-project-menu" unique-opened>
                         <el-sub-menu v-for="item in projectContractArr" :index="item.id">
                             <template #title>
-                                <HcIcon class="hc-menu-icon" name="folder-2"/>
+                                <HcIcon class="hc-menu-icon" name="folder-2" />
                                 <span>{{ item?.name }}</span>
                             </template>
-                            <el-menu-item v-for="items in item?.contractInfoList ?? []" :index="items?.id"
-                                          @click="projectMenuValue(item,items)">
-                                <HcIcon v-if="projectKey === items?.id" class="hc-menu-icon" fill name="star"/>
+                            <el-menu-item
+                                v-for="items in item?.contractInfoList ?? []" :index="items?.id"
+                                @click="projectMenuValue(item, items)"
+                            >
+                                <HcIcon v-if="projectKey === items?.id" class="hc-menu-icon" fill name="star" />
                                 <span>{{ items?.name }}</span>
                             </el-menu-item>
                         </el-sub-menu>
@@ -110,11 +134,11 @@
             </HcCard>
             <div v-if="basicFormEdit" class="hc-card-foot-box">
                 <el-button :loading="saveUserLoading" hc-btn type="primary" @click="saveUserInfoClick">
-                    <HcIcon name="save"/>
+                    <HcIcon name="save" />
                     <span>保存</span>
                 </el-button>
                 <el-button hc-btn @click="cancelUserClick">
-                    <HcIcon name="close"/>
+                    <HcIcon name="close" />
                     <span>取消</span>
                 </el-button>
             </div>
@@ -122,97 +146,114 @@
                 <template #search>
                     <div class="flex items-center">
                         <div class="w-32">
-                            <el-select v-model="searchLogForm.operationModule" clearable placeholder="业务模块"
-                                       @change="BusinessModuleValue">
-                                <el-option v-for="item in operationModuleData" :key="item.value"
-                                           :label="item?.dictValue" :value="item?.dictKey"/>
+                            <el-select
+                                v-model="searchLogForm.operationModule" clearable placeholder="业务模块"
+                                @change="BusinessModuleValue"
+                            >
+                                <el-option
+                                    v-for="item in operationModuleData" :key="item.value"
+                                    :label="item?.dictValue" :value="item?.dictKey"
+                                />
                             </el-select>
                         </div>
                         <div class="w-32 ml-2">
-                            <el-select v-model="searchLogForm.operationView" clearable placeholder="页面"
-                                       @change="OperationViewValue">
-                                <el-option v-for="item in operationViewData" :key="item.value" :label="item?.dictValue"
-                                           :value="item?.dictKey"/>
+                            <el-select
+                                v-model="searchLogForm.operationView" clearable placeholder="页面"
+                                @change="OperationViewValue"
+                            >
+                                <el-option
+                                    v-for="item in operationViewData" :key="item.value" :label="item?.dictValue"
+                                    :value="item?.dictKey"
+                                />
                             </el-select>
                         </div>
                         <div class="w-40 ml-2">
                             <el-select v-model="searchLogForm.operationType" clearable placeholder="操作类型">
-                                <el-option v-for="item in operationTypeData" :key="item.value" :label="item?.dictValue"
-                                           :value="item?.dictKey"/>
+                                <el-option
+                                    v-for="item in operationTypeData" :key="item.value" :label="item?.dictValue"
+                                    :value="item?.dictKey"
+                                />
                             </el-select>
                         </div>
                         <div class="w-20 ml-2">
                             <el-select v-model="searchLogForm.operationMedium" clearable placeholder="设备">
-                                <el-option v-for="item in deviceData" :key="item.value" :label="item?.label"
-                                           :value="item?.value"/>
+                                <el-option
+                                    v-for="item in deviceData" :key="item.value" :label="item?.label"
+                                    :value="item?.value"
+                                />
                             </el-select>
                         </div>
                         <div class="w-64 ml-2">
-                            <HcDatePicker :dates="betweenTime" clearable @change="betweenDateUpdate"/>
+                            <HcDatePicker :dates="betweenTime" clearable @change="betweenDateUpdate" />
                         </div>
                         <div class="w-60 ml-2">
-                            <el-input v-model="searchLogForm.queryValue" clearable placeholder="请输入名称关键词检索"
-                                      @keyup="keyUpEvent"/>
+                            <el-input
+                                v-model="searchLogForm.queryValue" clearable placeholder="请输入名称关键词检索"
+                                @keyup="keyUpEvent"
+                            />
                         </div>
                         <div class="ml-2">
                             <el-button type="primary" @click="searchClick">
-                                <HcIcon name="search-2"/>
+                                <HcIcon name="search-2" />
                                 <span>搜索</span>
                             </el-button>
                         </div>
                     </div>
                 </template>
                 <HcTable :column="logTableColumn" :datas="logTableData" :loading="logTableLoading">
-                    <template #operationContent="{row}">
+                    <template #operationContent="{ row }">
                         <div class="text-link text-cut" @click="tableOperationContent(row)">
                             {{ row?.operationContent }}
                         </div>
                     </template>
                 </HcTable>
                 <template #action>
-                    <HcPages :pages="searchLogForm" @change="pageLogChange"/>
+                    <HcPages :pages="searchLogForm" @change="pageLogChange" />
                 </template>
             </HcCard>
-            <HcCard v-if="menuKey === 'recycle'" actionSize="lg">
+            <HcCard v-if="menuKey === 'recycle'" action-size="lg">
                 <template #header>
                     <div class="mr-5">{{ menuItem.label }}</div>
-                    <HcNewSwitch :datas="userTypeTab" :keys="userTypeKey" @change="userTypeChange"/>
+                    <HcNewSwitch :datas="userTypeTab" :keys="userTypeKey" @change="userTypeChange" />
                 </template>
                 <template #extra>
-                    <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
+                    <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" />
                 </template>
-                <HcTable ref="recycleTableRef" :column="recycleTableColumn" :datas="recycleTableData"
-                         :loading="recycleTableLoading" isCheck @selection-change="recycleTableSelectionChange"/>
+                <HcTable
+                    ref="recycleTableRef" :column="recycleTableColumn" :datas="recycleTableData"
+                    :loading="recycleTableLoading" is-check @selection-change="recycleTableSelectionChange"
+                />
                 <template #action>
                     <div class="foot-recycle">
-                        <el-button :disabled="userTypeKey === '2'" :loading="recycleBtnLoading" hc-btn type="primary"
-                                   @click="recycleBtnClick">
-                            <HcIcon fill name="reply"/>
+                        <el-button
+                            :disabled="userTypeKey === '2'" :loading="recycleBtnLoading" hc-btn type="primary"
+                            @click="recycleBtnClick"
+                        >
+                            <HcIcon fill name="reply" />
                             <span>恢复</span>
                         </el-button>
-                        <HcPages :pages="searchRecycleForm" @change="pageRecycleChange"/>
+                        <HcPages :pages="searchRecycleForm" @change="pageRecycleChange" />
                     </div>
                 </template>
             </HcCard>
         </div>
 
-        <!--日志内容-->
+        <!-- 日志内容 -->
         <el-dialog v-model="operationContentModal" class="hc-modal-border" title="日志内容" width="38rem">
             {{ operationContent }}
         </el-dialog>
-
     </div>
 </template>
 
 <script setup>
-import {ref, onMounted} from "vue";
-import {useAppStore} from "~src/store";
-import userApi from "~api/userInfo/index"
-import {useRouter, useRoute} from 'vue-router'
-import avatarPng from '~src/assets/images/avatar.png';
-import {getTokenHeader} from '~src/api/request/header';
-import {arrIndex, formValidate, getArrValue, isPhone} from "js-fast-way"
-import md5 from 'js-md5';
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import userApi from '~api/userInfo/index'
+import { useRoute, useRouter } from 'vue-router'
+import avatarPng from '~src/assets/images/avatar.png'
+import { getTokenHeader } from '~src/api/request/header'
+import { arrIndex, formValidate, getArrValue, isPhone } from 'js-fast-way'
+import md5 from 'js-md5'
 
 //初始变量
 const router = useRouter()
@@ -220,18 +261,18 @@ const useRoutes = useRoute()
 const useAppState = useAppStore()
 
 //全局变量信息
-const userInfo = ref(useAppState.getUserInfo);
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectContractArr = ref(useAppState.getProjectContract);
+const userInfo = ref(useAppState.getUserInfo)
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectContractArr = ref(useAppState.getProjectContract)
 
 //路由参数数据
-const routerQuery = useRoutes?.query;
+const routerQuery = useRoutes?.query
 let MenuType = routerQuery?.MenuType || 'basic'
 
 //上传组件参数
-const action = '/api/blade-resource/oss/endpoint/put-file';
-const accept = 'image/png,image/jpg,image/jpeg';
+const action = '/api/blade-resource/oss/endpoint/put-file'
+const accept = 'image/png,image/jpg,image/jpeg'
 const upData = ref({})
 //上传前
 const avatarLoading = ref(false)
@@ -241,10 +282,10 @@ const beforeUpload = () => {
 }
 //上传完成
 const uploadFinish = async (res) => {
-    const link = res?.data?.link ?? '';
-    const user_id = userInfo.value?.user_id ?? '';
+    const link = res?.data?.link ?? ''
+    const user_id = userInfo.value?.user_id ?? ''
     if (link) {
-        const {error, code} = await userApi.updateUserInfo({avatar: link, id: user_id})
+        const { error, code } = await userApi.updateUserInfo({ avatar: link, id: user_id })
         if (!error && code === 200) {
             avatarLoading.value = false
             userInfo.value.avatar = link
@@ -269,12 +310,12 @@ const uploadError = () => {
 const menuKey = ref(MenuType)
 const menuItem = ref({})
 const menuOptions = ref([
-    {key: 'basic', label: '基础信息', icon: 'user-3'},
-    {key: 'password', label: '密码设置', icon: 'lock-unlock'},
-    {key: 'project', label: '参建项目', icon: 'folder-2'},
-    {key: 'log', label: '操作日志', icon: 'file-mark'},
-    {key: 'recycle', label: '回收站', icon: 'delete-bin-5'},
-]);
+    { key: 'basic', label: '基础信息', icon: 'user-3' },
+    { key: 'password', label: '密码设置', icon: 'lock-unlock' },
+    { key: 'project', label: '参建项目', icon: 'folder-2' },
+    { key: 'log', label: '操作日志', icon: 'file-mark' },
+    { key: 'recycle', label: '回收站', icon: 'delete-bin-5' },
+])
 //获取菜单对象数据
 const menuObjItem = () => {
     const index = arrIndex(menuOptions.value, 'key', menuKey.value)
@@ -287,8 +328,8 @@ const handleMenuValue = (item) => {
     router.push({
         path: useRoutes.path,
         query: {
-            MenuType: item?.key
-        }
+            MenuType: item?.key,
+        },
     })
     getPageTypeData(item?.key)
 }
@@ -342,12 +383,12 @@ const formUserRules = {
                 callback()
             }
         },
-        trigger: "blur"
+        trigger: 'blur',
     },
 }
 //获取用户信息
 const queryCurrentUserData = async () => {
-    const {error, code, data} = await userApi.queryCurrentUserData()
+    const { error, code, data } = await userApi.queryCurrentUserData()
     if (!error && code === 200) {
         formUserModel.value.deptId = data?.deptId || ''
         formUserModel.value.idNumber = data?.idNumber || ''
@@ -386,12 +427,12 @@ const cancelUserClick = () => {
 
 //保存用户信息
 const saveUserInfoData = async () => {
-    const {phone, user_id} = formUserModel.value
+    const { phone, user_id } = formUserModel.value
     if (phone && isPhone(phone)) {
         saveUserLoading.value = true
-        const {error, code} = await userApi.updateUserInfo({
+        const { error, code } = await userApi.updateUserInfo({
             phone: phone,
-            id: user_id
+            id: user_id,
         })
         if (!error && code === 200) {
             saveUserLoading.value = false
@@ -406,52 +447,52 @@ const saveUserInfoData = async () => {
 
 //密码设置表单
 const formUserPassRef = ref(null)
-const formUserPassModel = ref({oldPassword: '', newPassword: '', newPassword1: ''})
+const formUserPassModel = ref({ oldPassword: '', newPassword: '', newPassword1: '' })
 const formUserPassRules = {
     oldPassword: {
         required: true,
-        trigger: "blur",
-        message: "请输入原始密码"
+        trigger: 'blur',
+        message: '请输入原始密码',
     },
     newPassword: {
         required: true,
         validator(rule, value, callback) {
-            const pass = formUserPassModel.value.newPassword1;
+            const pass = formUserPassModel.value.newPassword1
             if (!value) {
-                callback(new Error("请输入新的密码"))
+                callback(new Error('请输入新的密码'))
             } else if (pass && value !== pass) {
-                callback(new Error("新的密码和确认新密码不一致"))
+                callback(new Error('新的密码和确认新密码不一致'))
             }
             callback()
         },
-        trigger: "blur"
+        trigger: 'blur',
     },
     newPassword1: {
         required: true,
         validator(rule, value, callback) {
-            const pass = formUserPassModel.value.newPassword;
+            const pass = formUserPassModel.value.newPassword
             if (!value) {
-                callback(new Error("请输入确认新密码"))
+                callback(new Error('请输入确认新密码'))
             } else if (pass && value !== pass) {
-                callback(new Error("新的密码和确认新密码不一致"))
+                callback(new Error('新的密码和确认新密码不一致'))
             }
             callback()
         },
-        trigger: "blur"
-    }
+        trigger: 'blur',
+    },
 }
 
 //更新密码
 const saveUpdatePassword = async () => {
     const res = await formValidate(formUserPassRef.value)
     if (res) {
-        const form = formUserPassModel.value;
+        const form = formUserPassModel.value
         saveUserLoading.value = true
-        const {error, code} = await userApi.updatePassword({
+        const { error, code } = await userApi.updatePassword({
             oldPassword: md5(form?.oldPassword),
             newPassword: md5(form?.newPassword),
             newPassword1: md5(form?.newPassword1),
-            plaintextPassword: form?.newPassword
+            plaintextPassword: form?.newPassword,
         })
         if (!error && code === 200) {
             saveUserLoading.value = false
@@ -459,7 +500,7 @@ const saveUpdatePassword = async () => {
             formUserPassModel.value = {
                 oldPassword: '',
                 newPassword: '',
-                newPassword1: ''
+                newPassword1: '',
             }
         } else {
             saveUserLoading.value = false
@@ -470,7 +511,7 @@ const saveUpdatePassword = async () => {
 //获取默认项目
 const projectKey = ref(null)
 const getDefaultProject = async () => {
-    const {error, code, data} = await userApi.getDefaultProject()
+    const { error, code, data } = await userApi.getDefaultProject()
     if (!error && code === 200) {
         projectKey.value = data['contractId']
     }
@@ -489,9 +530,9 @@ const projectMenuValue = (item, items) => {
 const setDefaultProjectClick = async () => {
     const pid = menuProjectId.value, cid = menuContractId.value
     if (pid && cid) {
-        const {error, code} = await userApi.setDefaultProject({
+        const { error, code } = await userApi.setDefaultProject({
             projectId: pid,
-            contractId: cid
+            contractId: cid,
         })
         if (!error && code === 200) {
             window?.$message?.success('设置成功')
@@ -505,13 +546,13 @@ const setDefaultProjectClick = async () => {
 const searchLogForm = ref({
     operationModule: null, operationView: null, operationType: null, operationMedium: null,
     queryValue: null, startTime: null, endTime: null,
-    current: 1, size: 10, total: 0
+    current: 1, size: 10, total: 0,
 })
 
 //业务模块
 const operationModuleData = ref([])
 const queryBusinessModule = async () => {
-    const {error, code, data} = await userApi.queryBusinessModule()
+    const { error, code, data } = await userApi.queryBusinessModule()
     if (!error && code === 200) {
         operationModuleData.value = data
     } else {
@@ -528,8 +569,8 @@ const BusinessModuleValue = () => {
 //页面
 const operationViewData = ref([])
 const queryOperationView = async () => {
-    const {error, code, data} = await userApi.queryOperationView({
-        businessModule: searchLogForm.value?.operationModule || ''
+    const { error, code, data } = await userApi.queryOperationView({
+        businessModule: searchLogForm.value?.operationModule || '',
     })
     if (!error && code === 200) {
         operationViewData.value = data
@@ -545,9 +586,9 @@ const OperationViewValue = () => {
 //操作类型
 const operationTypeData = ref([])
 const operationTypeStatus = async () => {
-    const {error, code, data} = await userApi.queryOperationTypeList({
+    const { error, code, data } = await userApi.queryOperationTypeList({
         businessModule: searchLogForm.value?.operationModule || '',
-        operationView: searchLogForm.value?.operationView || ''
+        operationView: searchLogForm.value?.operationView || '',
     })
     if (!error && code === 200) {
         operationTypeData.value = data
@@ -557,20 +598,20 @@ const operationTypeStatus = async () => {
 }
 
 //设备
-const deviceData = ref([{label: "APP", value: "APP"}, {label: "PC", value: "PC"}])
+const deviceData = ref([{ label: 'APP', value: 'APP' }, { label: 'PC', value: 'PC' }])
 //表格数据
 const logTableColumn = ref([
-    {key: 'operationModule', name: '业务模块', width: '180'},
-    {key: 'operationTypeValue', name: '操作类型', width: '220'},
-    {key: 'operationMedium', name: '设备', align: 'center', width: '80'},
-    {key: 'operationContent', name: '操作内容'},
-    {key: 'createTime', name: '操作时间', align: 'center', width: '180'},
+    { key: 'operationModule', name: '业务模块', width: '180' },
+    { key: 'operationTypeValue', name: '操作类型', width: '220' },
+    { key: 'operationMedium', name: '设备', align: 'center', width: '80' },
+    { key: 'operationContent', name: '操作内容' },
+    { key: 'createTime', name: '操作时间', align: 'center', width: '180' },
 ])
-const logTableData = ref([]);
+const logTableData = ref([])
 
 //日期时间被选择
 const betweenTime = ref(null)
-const betweenDateUpdate = ({val, arr}) => {
+const betweenDateUpdate = ({ val, arr }) => {
     betweenTime.value = arr
     searchLogForm.value.startTime = val?.start
     searchLogForm.value.endTime = val?.end
@@ -578,20 +619,20 @@ const betweenDateUpdate = ({val, arr}) => {
 
 //回车搜索
 const keyUpEvent = (e) => {
-    if (e.key === "Enter") {
-        searchLogForm.value.current = 1;
+    if (e.key === 'Enter') {
+        searchLogForm.value.current = 1
         getLogTableData()
     }
 }
 
 //搜索
 const searchClick = () => {
-    searchLogForm.value.current = 1;
+    searchLogForm.value.current = 1
     getLogTableData()
 }
 
 //分页被点击
-const pageLogChange = ({current, size}) => {
+const pageLogChange = ({ current, size }) => {
     searchLogForm.value.current = current
     searchLogForm.value.size = size
     getLogTableData()
@@ -601,10 +642,10 @@ const pageLogChange = ({current, size}) => {
 const logTableLoading = ref(false)
 const getLogTableData = async () => {
     logTableLoading.value = true
-    const {error, code, data} = await userApi.getOperationLog({
+    const { error, code, data } = await userApi.getOperationLog({
         projectId: projectId.value,
         contractId: contractId.value,
-        ...searchLogForm.value
+        ...searchLogForm.value,
     })
     logTableLoading.value = false
     if (!error && code === 200) {
@@ -627,9 +668,9 @@ const tableOperationContent = (row) => {
 
 //个人和全部切换
 const userTypeKey = ref('1')
-const userTypeTab = ref([{key: '1', name: '个人'}, {key: '2', name: '全部'}]);
+const userTypeTab = ref([{ key: '1', name: '个人' }, { key: '2', name: '全部' }])
 const userTypeChange = (item) => {
-    userTypeKey.value = item?.key;
+    userTypeKey.value = item?.key
     if (item?.key === '1') {
         searchRecycleForm.value.createUserName = ''
     } else {
@@ -641,12 +682,12 @@ const userTypeChange = (item) => {
 //结构类型tab数据和相关处理
 const tabTypeKey = ref('1')
 const tabTypeTab = ref([
-    {key: '1', name: '文件资料'},
-    {key: '2', name: '工程划分'}
-]);
+    { key: '1', name: '文件资料' },
+    { key: '2', name: '工程划分' },
+])
 const tabTypeChange = (item) => {
-    tabTypeKey.value = item?.key;
-    tabTypeKey.value = item?.key;
+    tabTypeKey.value = item?.key
+    tabTypeKey.value = item?.key
     searchRecycleForm.value.current = 1
     searchRecycleForm.value.delType = item?.key
     getRecycleTableData()
@@ -655,22 +696,22 @@ const tabTypeChange = (item) => {
 //搜索和分页数据
 const searchRecycleForm = ref({
     projectId: projectId.value, contractId: contractId.value, createUserName: '',
-    delType: tabTypeKey.value, current: 1, size: 20, total: 0
+    delType: tabTypeKey.value, current: 1, size: 20, total: 0,
 })
 
 //表格数据
 const recycleTableRef = ref(null)
 const recycleTableColumn = ref([
-    {key: 'fileName', name: '删除内容'},
-    {key: 'position', name: '父节点名称'},
-    {key: 'createUserName', name: '操作人'},
-    {key: 'operationTime', name: '删除时间', align: 'center', width: '180'},
+    { key: 'fileName', name: '删除内容' },
+    { key: 'position', name: '父节点名称' },
+    { key: 'createUserName', name: '操作人' },
+    { key: 'operationTime', name: '删除时间', align: 'center', width: '180' },
 ])
 const recycleTableLoading = ref(false)
-const recycleTableData = ref(null);
+const recycleTableData = ref(null)
 
 //分页被点击
-const pageRecycleChange = ({current, size}) => {
+const pageRecycleChange = ({ current, size }) => {
     searchRecycleForm.value.current = current
     searchRecycleForm.value.size = size
     getRecycleTableData()
@@ -678,11 +719,11 @@ const pageRecycleChange = ({current, size}) => {
 
 //获取数据
 const getRecycleTableData = async () => {
-    const {error, code, data} = await userApi.queryRecycleBinList({
+    const { error, code, data } = await userApi.queryRecycleBinList({
         projectId: projectId.value,
         contractId: contractId.value,
         delType: tabTypeKey.value,
-        ...searchRecycleForm.value
+        ...searchRecycleForm.value,
     })
     if (!error && code === 200) {
         recycleTableData.value = getArrValue(data['records'])
@@ -694,7 +735,7 @@ const getRecycleTableData = async () => {
 }
 
 //多选
-const RecycleCheckedKeys = ref([]);
+const RecycleCheckedKeys = ref([])
 const recycleTableSelectionChange = (val) => {
     RecycleCheckedKeys.value = val
 }
@@ -706,11 +747,11 @@ const recycleBtnClick = async () => {
     if (rows.length > 0) {
         //请求数据
         recycleBtnLoading.value = true
-        const {error, code} = await userApi.recycleBinRegain({
+        const { error, code } = await userApi.recycleBinRegain({
             projectId: projectId.value,
             contractId: contractId.value,
             delType: tabTypeKey.value,
-            regainIds: rows
+            regainIds: rows,
         })
         recycleBtnLoading.value = false
         if (!error && code === 200) {