Browse Source

修改文件

ZaiZai 10 months ago
parent
commit
ed8a6c54d0

+ 1 - 1
src/views/system/dict.vue

@@ -113,7 +113,7 @@ const tableRef = ref(null)
 const tableColumn = ref([
     { key: 'code', name: '字典编号' },
     { key: 'dictValue', name: '字典名称' },
-    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'isSealed', name: '封存', width: 70, align: 'center' },
     { key: 'remark', name: '字典备注' },
     { key: 'action', name: '操作', width: 120, align: 'center' },
 ])

+ 1 - 1
src/views/system/dictbiz.vue

@@ -114,7 +114,7 @@ const tableRef = ref(null)
 const tableColumn = ref([
     { key: 'code', name: '字典编号' },
     { key: 'dictValue', name: '字典名称' },
-    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'isSealed', name: '封存', width: 70, align: 'center' },
     { key: 'remark', name: '字典备注' },
     { key: 'action', name: '操作', width: 120, align: 'center' },
 ])

+ 22 - 38
src/views/system/modules/dict/dict.vue

@@ -1,5 +1,5 @@
 <template>
-    <hc-dialog v-model="isShow" widths="800px" is-table :footer="false" :is-close="false">
+    <hc-dialog v-model="isShow" widths="800px" :footer="false" :is-close="false" :padding="false">
         <template #header>
             <div class="hc-flex">
                 <div class="hc-flex flex-1">
@@ -22,7 +22,7 @@
         </template>
         <hc-table
             ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
-            is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
+            is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }" class="mt-10px"
             @selection-change="tableCheckChange"
         >
             <template #isSealed="{ row }">
@@ -36,7 +36,7 @@
     </hc-dialog>
 
     <!-- 新增/修改 -->
-    <hc-dialog v-model="isDialogShow" widths="550px" is-footer-center :title="dialogTitle" @close="dialogClose">
+    <hc-dialog v-model="isDialogShow" widths="34rem" is-footer-center :title="dialogTitle" @close="dialogClose">
         <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
             <el-row :gutter="20">
                 <el-col :span="12">
@@ -73,7 +73,7 @@
                     <el-form-item label="字典封存:" prop="isSealed">
                         <el-radio-group v-model="formModel.isSealed">
                             <el-radio :value="1">是</el-radio>
-                            <el-radio :value="0">否</el-radio>
+                            <el-radio :value="0" class="ml-20px">否</el-radio>
                         </el-radio-group>
                     </el-form-item>
                 </el-col>
@@ -131,7 +131,7 @@ const tableColumn = ref([
     { key: 'code', name: '字典编号' },
     { key: 'dictValue', name: '字典名称' },
     { key: 'dictKey', name: '字典键值' },
-    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'isSealed', name: '封存', width: 70, align: 'center' },
     { key: 'remark', name: '字典备注' },
     { key: 'action', name: '操作', width: 100, align: 'center' },
 ])
@@ -150,13 +150,9 @@ const getTableData = async () => {
     if (searchName.value) {
         form[searchType.value] = searchName.value
     }
-    const { error, code, data } = await mainApi.getChildList(form)
+    const { data } = await mainApi.getChildList(form)
     tableLoading.value = false
-    if (!error && code === 200) {
-        tableData.value = getArrValue(data)
-    } else {
-        tableData.value = []
-    }
+    tableData.value = getArrValue(data)
 }
 
 //表格被选择
@@ -219,15 +215,11 @@ const editRowClick = (row) => {
 
 //删除
 const delRowClick = async ({ item }, resolve) => {
-    const { code, msg } = await mainApi.del(item.id)
-    if (code === 200) {
-        resolve()
-        window.$message.success('删除成功')
-        getTableData().then()
-    } else {
-        resolve()
-        window.$message.error(msg ?? '删除失败')
-    }
+    const { isRes } = await mainApi.del(item.id)
+    resolve() //关闭弹窗
+    if (!isRes) return
+    window.$message.success('删除成功')
+    getTableData().then()
 }
 
 //批量删除
@@ -241,16 +233,11 @@ const delClick = () => {
     HcDelMsg(async (resolve) => {
         //发起请求
         const ids = arrToId(rows)
-        const { code, msg } = await mainApi.del(ids)
-        //关闭弹窗的回调
-        resolve()
-        //处理结果
-        if (code === 200) {
-            window.$message.success('删除成功')
-            getTableData().then()
-        } else {
-            window.$message.error(msg ?? '删除失败')
-        }
+        const { isRes } = await mainApi.del(ids)
+        resolve() //关闭弹窗的回调
+        if (!isRes) return
+        window.$message.success('删除成功')
+        getTableData().then()
     })
 }
 
@@ -261,15 +248,12 @@ const dialogSubmit = async () => {
     if (!formRes) return false
     submitLoading.value = true
     //发起请求
-    const { error, code, msg } = await mainApi.submit(formModel.value)
+    const { isRes } = await mainApi.submit(formModel.value)
     submitLoading.value = false
-    if (!error && code === 200) {
-        dialogClose()
-        window?.$message?.success('操作成功')
-        getTableData().then()
-    } else {
-        window?.$message?.error(msg ?? '操作失败')
-    }
+    if (!isRes) return
+    dialogClose()
+    window?.$message?.success('操作成功')
+    getTableData().then()
 }
 
 //关闭弹窗

+ 22 - 38
src/views/system/modules/dictbiz/dictbiz.vue

@@ -1,5 +1,5 @@
 <template>
-    <hc-dialog v-model="isShow" widths="800px" is-table :footer="false" :is-close="false">
+    <hc-dialog v-model="isShow" widths="800px" :footer="false" :is-close="false" :padding="false">
         <template #header>
             <div class="hc-flex">
                 <div class="hc-flex flex-1">
@@ -23,7 +23,7 @@
         <hc-table
             ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
             is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
-            @selection-change="tableCheckChange"
+            class="mt-10px" @selection-change="tableCheckChange"
         >
             <template #isSealed="{ row }">
                 {{ row.isSealed === 1 ? '是' : '否' }}
@@ -36,7 +36,7 @@
     </hc-dialog>
 
     <!-- 新增/修改 -->
-    <hc-dialog v-model="isDialogShow" widths="550px" is-footer-center :title="dialogTitle" @close="dialogClose">
+    <hc-dialog v-model="isDialogShow" widths="34rem" is-footer-center :title="dialogTitle" @close="dialogClose">
         <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
             <el-row :gutter="20">
                 <el-col :span="12">
@@ -73,7 +73,7 @@
                     <el-form-item label="字典封存:" prop="isSealed">
                         <el-radio-group v-model="formModel.isSealed">
                             <el-radio :value="1">是</el-radio>
-                            <el-radio :value="0">否</el-radio>
+                            <el-radio :value="0" class="ml-20px">否</el-radio>
                         </el-radio-group>
                     </el-form-item>
                 </el-col>
@@ -131,7 +131,7 @@ const tableColumn = ref([
     { key: 'code', name: '字典编号' },
     { key: 'dictValue', name: '字典名称' },
     { key: 'dictKey', name: '字典键值' },
-    { key: 'isSealed', name: '封存', width: 80 },
+    { key: 'isSealed', name: '封存', width: 70, align: 'center' },
     { key: 'remark', name: '字典备注' },
     { key: 'action', name: '操作', width: 100, align: 'center' },
 ])
@@ -150,13 +150,9 @@ const getTableData = async () => {
     if (searchName.value) {
         form[searchType.value] = searchName.value
     }
-    const { error, code, data } = await mainApi.getChildList(form)
+    const { data } = await mainApi.getChildList(form)
     tableLoading.value = false
-    if (!error && code === 200) {
-        tableData.value = getArrValue(data)
-    } else {
-        tableData.value = []
-    }
+    tableData.value = getArrValue(data)
 }
 
 //表格被选择
@@ -219,15 +215,11 @@ const editRowClick = (row) => {
 
 //删除
 const delRowClick = async ({ item }, resolve) => {
-    const { code, msg } = await mainApi.del(item.id)
-    if (code === 200) {
-        resolve()
-        window.$message.success('删除成功')
-        getTableData().then()
-    } else {
-        resolve()
-        window.$message.error(msg ?? '删除失败')
-    }
+    const { isRes } = await mainApi.del(item.id)
+    resolve() //关闭弹窗
+    if (!isRes) return
+    window.$message.success('删除成功')
+    getTableData().then()
 }
 
 //批量删除
@@ -241,16 +233,11 @@ const delClick = () => {
     HcDelMsg(async (resolve) => {
         //发起请求
         const ids = arrToId(rows)
-        const { code, msg } = await mainApi.del(ids)
-        //关闭弹窗的回调
-        resolve()
-        //处理结果
-        if (code === 200) {
-            window.$message.success('删除成功')
-            getTableData().then()
-        } else {
-            window.$message.error(msg ?? '删除失败')
-        }
+        const { isRes } = await mainApi.del(ids)
+        resolve() //关闭弹窗的回调
+        if (!isRes) return
+        window.$message.success('删除成功')
+        getTableData().then()
     })
 }
 
@@ -261,15 +248,12 @@ const dialogSubmit = async () => {
     if (!formRes) return false
     submitLoading.value = true
     //发起请求
-    const { error, code, msg } = await mainApi.submit(formModel.value)
+    const { isRes } = await mainApi.submit(formModel.value)
     submitLoading.value = false
-    if (!error && code === 200) {
-        dialogClose()
-        window?.$message?.success('操作成功')
-        getTableData().then()
-    } else {
-        window?.$message?.error(msg ?? '操作失败')
-    }
+    if (!isRes) return
+    dialogClose()
+    window?.$message?.success('操作成功')
+    getTableData().then()
 }
 
 //关闭弹窗