正在显示
20 个修改的文件
包含
987 行增加
和
665 行删除
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="企业名称" prop="name"> | 11 | <el-form-item label="企业名称" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="企业名称" prop="name"> | 11 | <el-form-item label="企业名称" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | :model="queryParams" | 5 | :model="queryParams" |
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | :inline="true" | 7 | :inline="true" |
| 8 | - label-width="68px" | 8 | + label-width="80px" |
| 9 | > | 9 | > |
| 10 | <el-form-item label="企业名称" prop="name"> | 10 | <el-form-item label="企业名称" prop="name"> |
| 11 | <el-input | 11 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="企业名称" prop="name"> | 11 | <el-form-item label="企业名称" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | :model="queryParams" | 5 | :model="queryParams" |
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | :inline="true" | 7 | :inline="true" |
| 8 | - label-width="68px" | 8 | + label-width="80px" |
| 9 | > | 9 | > |
| 10 | <el-form-item label="企业名称" prop="name"> | 10 | <el-form-item label="企业名称" prop="name"> |
| 11 | <el-input | 11 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="企业名称" prop="name"> | 11 | <el-form-item label="企业名称" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | :model="queryParams" | 5 | :model="queryParams" |
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | :inline="true" | 7 | :inline="true" |
| 8 | - label-width="68px" | 8 | + label-width="80px" |
| 9 | > | 9 | > |
| 10 | <el-form-item label="车辆品牌" prop="name"> | 10 | <el-form-item label="车辆品牌" prop="name"> |
| 11 | <el-input | 11 | <el-input |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | :model="queryParams" | 5 | :model="queryParams" |
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | :inline="true" | 7 | :inline="true" |
| 8 | - label-width="68px" | 8 | + label-width="80px" |
| 9 | > | 9 | > |
| 10 | <el-form-item label="车辆类型" prop="typeName"> | 10 | <el-form-item label="车辆类型" prop="typeName"> |
| 11 | <el-input | 11 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="车主姓名" prop="name"> | 11 | <el-form-item label="车主姓名" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="用户姓名" prop="name"> | 11 | <el-form-item label="用户姓名" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | :model="queryParams" | 5 | :model="queryParams" |
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | :inline="true" | 7 | :inline="true" |
| 8 | - label-width="68px" | 8 | + label-width="80px" |
| 9 | > | 9 | > |
| 10 | <el-form-item label="车主姓名" prop="name"> | 10 | <el-form-item label="车主姓名" prop="name"> |
| 11 | <el-input | 11 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="用户姓名" prop="name"> | 11 | <el-form-item label="用户姓名" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | :model="queryParams" | 5 | :model="queryParams" |
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | :inline="true" | 7 | :inline="true" |
| 8 | - label-width="68px" | 8 | + label-width="80px" |
| 9 | > | 9 | > |
| 10 | <el-form-item label="车主姓名" prop="name"> | 10 | <el-form-item label="车主姓名" prop="name"> |
| 11 | <el-input | 11 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="用户姓名" prop="name"> | 11 | <el-form-item label="用户姓名" prop="name"> |
| 12 | <el-input | 12 | <el-input |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="分配机制" prop="associationapprovetype"> | 11 | <el-form-item label="分配机制" prop="associationapprovetype"> |
| 12 | <el-select | 12 | <el-select |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | ref="queryRef" | 6 | ref="queryRef" |
| 7 | v-show="showSearch" | 7 | v-show="showSearch" |
| 8 | :inline="true" | 8 | :inline="true" |
| 9 | - label-width="68px" | 9 | + label-width="80px" |
| 10 | > | 10 | > |
| 11 | <el-form-item label="分配机制" prop="associationapprovetype"> | 11 | <el-form-item label="分配机制" prop="associationapprovetype"> |
| 12 | <el-select | 12 | <el-select |
| 1 | <template> | 1 | <template> |
| 2 | - <div class="app-container"> | ||
| 3 | - <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> | ||
| 4 | - <el-form-item label="参数名称" prop="configName"> | ||
| 5 | - <el-input | ||
| 6 | - v-model="queryParams.configName" | ||
| 7 | - placeholder="请输入参数名称" | ||
| 8 | - clearable | ||
| 9 | - style="width: 240px" | ||
| 10 | - @keyup.enter="handleQuery" | ||
| 11 | - /> | ||
| 12 | - </el-form-item> | ||
| 13 | - <el-form-item label="参数键名" prop="configKey"> | ||
| 14 | - <el-input | ||
| 15 | - v-model="queryParams.configKey" | ||
| 16 | - placeholder="请输入参数键名" | ||
| 17 | - clearable | ||
| 18 | - style="width: 240px" | ||
| 19 | - @keyup.enter="handleQuery" | ||
| 20 | - /> | ||
| 21 | - </el-form-item> | ||
| 22 | - <el-form-item label="系统内置" prop="configType"> | ||
| 23 | - <el-select v-model="queryParams.configType" placeholder="系统内置" clearable> | ||
| 24 | - <el-option | ||
| 25 | - v-for="dict in sys_yes_no" | ||
| 26 | - :key="dict.value" | ||
| 27 | - :label="dict.label" | ||
| 28 | - :value="dict.value" | ||
| 29 | - /> | ||
| 30 | - </el-select> | ||
| 31 | - </el-form-item> | ||
| 32 | - <el-form-item label="创建时间" style="width: 308px;"> | ||
| 33 | - <el-date-picker | ||
| 34 | - v-model="dateRange" | ||
| 35 | - value-format="YYYY-MM-DD" | ||
| 36 | - type="daterange" | ||
| 37 | - range-separator="-" | ||
| 38 | - start-placeholder="开始日期" | ||
| 39 | - end-placeholder="结束日期" | ||
| 40 | - ></el-date-picker> | ||
| 41 | - </el-form-item> | ||
| 42 | - <el-form-item> | ||
| 43 | - <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||
| 44 | - <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||
| 45 | - </el-form-item> | ||
| 46 | - </el-form> | ||
| 47 | - | ||
| 48 | - <el-row :gutter="10" class="mb8"> | ||
| 49 | - <el-col :span="1.5"> | ||
| 50 | - <el-button | ||
| 51 | - type="primary" | ||
| 52 | - plain | ||
| 53 | - icon="Plus" | ||
| 54 | - @click="handleAdd" | ||
| 55 | - v-hasPermi="['system:config:add']" | ||
| 56 | - >新增</el-button> | ||
| 57 | - </el-col> | ||
| 58 | - <el-col :span="1.5"> | ||
| 59 | - <el-button | ||
| 60 | - type="success" | ||
| 61 | - plain | ||
| 62 | - icon="Edit" | ||
| 63 | - :disabled="single" | ||
| 64 | - @click="handleUpdate" | ||
| 65 | - v-hasPermi="['system:config:edit']" | ||
| 66 | - >修改</el-button> | ||
| 67 | - </el-col> | ||
| 68 | - <el-col :span="1.5"> | ||
| 69 | - <el-button | ||
| 70 | - type="danger" | ||
| 71 | - plain | ||
| 72 | - icon="Delete" | ||
| 73 | - :disabled="multiple" | ||
| 74 | - @click="handleDelete" | ||
| 75 | - v-hasPermi="['system:config:remove']" | ||
| 76 | - >删除</el-button> | ||
| 77 | - </el-col> | ||
| 78 | - <el-col :span="1.5"> | ||
| 79 | - <el-button | ||
| 80 | - type="warning" | ||
| 81 | - plain | ||
| 82 | - icon="Download" | ||
| 83 | - @click="handleExport" | ||
| 84 | - v-hasPermi="['system:config:export']" | ||
| 85 | - >导出</el-button> | ||
| 86 | - </el-col> | ||
| 87 | - <el-col :span="1.5"> | ||
| 88 | - <el-button | ||
| 89 | - type="danger" | ||
| 90 | - plain | ||
| 91 | - icon="Refresh" | ||
| 92 | - @click="handleRefreshCache" | ||
| 93 | - v-hasPermi="['system:config:remove']" | ||
| 94 | - >刷新缓存</el-button> | ||
| 95 | - </el-col> | ||
| 96 | - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||
| 97 | - </el-row> | 2 | + <div class="app-container"> |
| 3 | + <el-form | ||
| 4 | + :model="queryParams" | ||
| 5 | + ref="queryRef" | ||
| 6 | + :inline="true" | ||
| 7 | + v-show="showSearch" | ||
| 8 | + label-width="80px" | ||
| 9 | + > | ||
| 10 | + <el-form-item label="参数名称" prop="configName"> | ||
| 11 | + <el-input | ||
| 12 | + v-model="queryParams.configName" | ||
| 13 | + placeholder="请输入参数名称" | ||
| 14 | + clearable | ||
| 15 | + style="width: 240px" | ||
| 16 | + @keyup.enter="handleQuery" | ||
| 17 | + /> | ||
| 18 | + </el-form-item> | ||
| 19 | + <el-form-item label="参数键名" prop="configKey"> | ||
| 20 | + <el-input | ||
| 21 | + v-model="queryParams.configKey" | ||
| 22 | + placeholder="请输入参数键名" | ||
| 23 | + clearable | ||
| 24 | + style="width: 240px" | ||
| 25 | + @keyup.enter="handleQuery" | ||
| 26 | + /> | ||
| 27 | + </el-form-item> | ||
| 28 | + <el-form-item label="系统内置" prop="configType"> | ||
| 29 | + <el-select | ||
| 30 | + v-model="queryParams.configType" | ||
| 31 | + placeholder="系统内置" | ||
| 32 | + clearable | ||
| 33 | + > | ||
| 34 | + <el-option | ||
| 35 | + v-for="dict in sys_yes_no" | ||
| 36 | + :key="dict.value" | ||
| 37 | + :label="dict.label" | ||
| 38 | + :value="dict.value" | ||
| 39 | + /> | ||
| 40 | + </el-select> | ||
| 41 | + </el-form-item> | ||
| 42 | + <el-form-item label="创建时间" style="width: 308px"> | ||
| 43 | + <el-date-picker | ||
| 44 | + v-model="dateRange" | ||
| 45 | + value-format="YYYY-MM-DD" | ||
| 46 | + type="daterange" | ||
| 47 | + range-separator="-" | ||
| 48 | + start-placeholder="开始日期" | ||
| 49 | + end-placeholder="结束日期" | ||
| 50 | + ></el-date-picker> | ||
| 51 | + </el-form-item> | ||
| 52 | + <el-form-item> | ||
| 53 | + <el-button type="primary" icon="Search" @click="handleQuery" | ||
| 54 | + >搜索</el-button | ||
| 55 | + > | ||
| 56 | + <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||
| 57 | + </el-form-item> | ||
| 58 | + </el-form> | ||
| 98 | 59 | ||
| 99 | - <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"> | ||
| 100 | - <el-table-column type="selection" width="55" align="center" /> | ||
| 101 | - <el-table-column label="参数主键" align="center" prop="configId" /> | ||
| 102 | - <el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" /> | ||
| 103 | - <el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" /> | ||
| 104 | - <el-table-column label="参数键值" align="center" prop="configValue" /> | ||
| 105 | - <el-table-column label="系统内置" align="center" prop="configType"> | ||
| 106 | - <template #default="scope"> | ||
| 107 | - <dict-tag :options="sys_yes_no" :value="scope.row.configType" /> | ||
| 108 | - </template> | ||
| 109 | - </el-table-column> | ||
| 110 | - <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> | ||
| 111 | - <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | ||
| 112 | - <template #default="scope"> | ||
| 113 | - <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 114 | - </template> | ||
| 115 | - </el-table-column> | ||
| 116 | - <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width"> | ||
| 117 | - <template #default="scope"> | ||
| 118 | - <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:config:edit']" >修改</el-button> | ||
| 119 | - <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:config:remove']">删除</el-button> | ||
| 120 | - </template> | ||
| 121 | - </el-table-column> | ||
| 122 | - </el-table> | 60 | + <el-row :gutter="10" class="mb8"> |
| 61 | + <el-col :span="1.5"> | ||
| 62 | + <el-button | ||
| 63 | + type="primary" | ||
| 64 | + plain | ||
| 65 | + icon="Plus" | ||
| 66 | + @click="handleAdd" | ||
| 67 | + v-hasPermi="['system:config:add']" | ||
| 68 | + >新增</el-button | ||
| 69 | + > | ||
| 70 | + </el-col> | ||
| 71 | + <el-col :span="1.5"> | ||
| 72 | + <el-button | ||
| 73 | + type="success" | ||
| 74 | + plain | ||
| 75 | + icon="Edit" | ||
| 76 | + :disabled="single" | ||
| 77 | + @click="handleUpdate" | ||
| 78 | + v-hasPermi="['system:config:edit']" | ||
| 79 | + >修改</el-button | ||
| 80 | + > | ||
| 81 | + </el-col> | ||
| 82 | + <el-col :span="1.5"> | ||
| 83 | + <el-button | ||
| 84 | + type="danger" | ||
| 85 | + plain | ||
| 86 | + icon="Delete" | ||
| 87 | + :disabled="multiple" | ||
| 88 | + @click="handleDelete" | ||
| 89 | + v-hasPermi="['system:config:remove']" | ||
| 90 | + >删除</el-button | ||
| 91 | + > | ||
| 92 | + </el-col> | ||
| 93 | + <el-col :span="1.5"> | ||
| 94 | + <el-button | ||
| 95 | + type="warning" | ||
| 96 | + plain | ||
| 97 | + icon="Download" | ||
| 98 | + @click="handleExport" | ||
| 99 | + v-hasPermi="['system:config:export']" | ||
| 100 | + >导出</el-button | ||
| 101 | + > | ||
| 102 | + </el-col> | ||
| 103 | + <el-col :span="1.5"> | ||
| 104 | + <el-button | ||
| 105 | + type="danger" | ||
| 106 | + plain | ||
| 107 | + icon="Refresh" | ||
| 108 | + @click="handleRefreshCache" | ||
| 109 | + v-hasPermi="['system:config:remove']" | ||
| 110 | + >刷新缓存</el-button | ||
| 111 | + > | ||
| 112 | + </el-col> | ||
| 113 | + <right-toolbar | ||
| 114 | + v-model:showSearch="showSearch" | ||
| 115 | + @queryTable="getList" | ||
| 116 | + ></right-toolbar> | ||
| 117 | + </el-row> | ||
| 123 | 118 | ||
| 124 | - <pagination | ||
| 125 | - v-show="total > 0" | ||
| 126 | - :total="total" | ||
| 127 | - v-model:page="queryParams.pageNum" | ||
| 128 | - v-model:limit="queryParams.pageSize" | ||
| 129 | - @pagination="getList" | 119 | + <el-table |
| 120 | + v-loading="loading" | ||
| 121 | + :data="configList" | ||
| 122 | + @selection-change="handleSelectionChange" | ||
| 123 | + > | ||
| 124 | + <el-table-column type="selection" width="55" align="center" /> | ||
| 125 | + <el-table-column label="参数主键" align="center" prop="configId" /> | ||
| 126 | + <el-table-column | ||
| 127 | + label="参数名称" | ||
| 128 | + align="center" | ||
| 129 | + prop="configName" | ||
| 130 | + :show-overflow-tooltip="true" | ||
| 131 | + /> | ||
| 132 | + <el-table-column | ||
| 133 | + label="参数键名" | ||
| 134 | + align="center" | ||
| 135 | + prop="configKey" | ||
| 136 | + :show-overflow-tooltip="true" | ||
| 130 | /> | 137 | /> |
| 138 | + <el-table-column label="参数键值" align="center" prop="configValue" /> | ||
| 139 | + <el-table-column label="系统内置" align="center" prop="configType"> | ||
| 140 | + <template #default="scope"> | ||
| 141 | + <dict-tag :options="sys_yes_no" :value="scope.row.configType" /> | ||
| 142 | + </template> | ||
| 143 | + </el-table-column> | ||
| 144 | + <el-table-column | ||
| 145 | + label="备注" | ||
| 146 | + align="center" | ||
| 147 | + prop="remark" | ||
| 148 | + :show-overflow-tooltip="true" | ||
| 149 | + /> | ||
| 150 | + <el-table-column | ||
| 151 | + label="创建时间" | ||
| 152 | + align="center" | ||
| 153 | + prop="createTime" | ||
| 154 | + width="180" | ||
| 155 | + > | ||
| 156 | + <template #default="scope"> | ||
| 157 | + <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 158 | + </template> | ||
| 159 | + </el-table-column> | ||
| 160 | + <el-table-column | ||
| 161 | + label="操作" | ||
| 162 | + align="center" | ||
| 163 | + width="150" | ||
| 164 | + class-name="small-padding fixed-width" | ||
| 165 | + > | ||
| 166 | + <template #default="scope"> | ||
| 167 | + <el-button | ||
| 168 | + link | ||
| 169 | + type="primary" | ||
| 170 | + icon="Edit" | ||
| 171 | + @click="handleUpdate(scope.row)" | ||
| 172 | + v-hasPermi="['system:config:edit']" | ||
| 173 | + >修改</el-button | ||
| 174 | + > | ||
| 175 | + <el-button | ||
| 176 | + link | ||
| 177 | + type="primary" | ||
| 178 | + icon="Delete" | ||
| 179 | + @click="handleDelete(scope.row)" | ||
| 180 | + v-hasPermi="['system:config:remove']" | ||
| 181 | + >删除</el-button | ||
| 182 | + > | ||
| 183 | + </template> | ||
| 184 | + </el-table-column> | ||
| 185 | + </el-table> | ||
| 186 | + | ||
| 187 | + <pagination | ||
| 188 | + v-show="total > 0" | ||
| 189 | + :total="total" | ||
| 190 | + v-model:page="queryParams.pageNum" | ||
| 191 | + v-model:limit="queryParams.pageSize" | ||
| 192 | + @pagination="getList" | ||
| 193 | + /> | ||
| 131 | 194 | ||
| 132 | - <!-- 添加或修改参数配置对话框 --> | ||
| 133 | - <el-dialog :title="title" v-model="open" width="500px" append-to-body> | ||
| 134 | - <el-form ref="configRef" :model="form" :rules="rules" label-width="80px"> | ||
| 135 | - <el-form-item label="参数名称" prop="configName"> | ||
| 136 | - <el-input v-model="form.configName" placeholder="请输入参数名称" /> | ||
| 137 | - </el-form-item> | ||
| 138 | - <el-form-item label="参数键名" prop="configKey"> | ||
| 139 | - <el-input v-model="form.configKey" placeholder="请输入参数键名" /> | ||
| 140 | - </el-form-item> | ||
| 141 | - <el-form-item label="参数键值" prop="configValue"> | ||
| 142 | - <el-input v-model="form.configValue" placeholder="请输入参数键值" /> | ||
| 143 | - </el-form-item> | ||
| 144 | - <el-form-item label="系统内置" prop="configType"> | ||
| 145 | - <el-radio-group v-model="form.configType"> | ||
| 146 | - <el-radio | ||
| 147 | - v-for="dict in sys_yes_no" | ||
| 148 | - :key="dict.value" | ||
| 149 | - :label="dict.value" | ||
| 150 | - >{{ dict.label }}</el-radio> | ||
| 151 | - </el-radio-group> | ||
| 152 | - </el-form-item> | ||
| 153 | - <el-form-item label="备注" prop="remark"> | ||
| 154 | - <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||
| 155 | - </el-form-item> | ||
| 156 | - </el-form> | ||
| 157 | - <template #footer> | ||
| 158 | - <div class="dialog-footer"> | ||
| 159 | - <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 160 | - <el-button @click="cancel">取 消</el-button> | ||
| 161 | - </div> | ||
| 162 | - </template> | ||
| 163 | - </el-dialog> | ||
| 164 | - </div> | 195 | + <!-- 添加或修改参数配置对话框 --> |
| 196 | + <el-dialog :title="title" v-model="open" width="500px" append-to-body> | ||
| 197 | + <el-form ref="configRef" :model="form" :rules="rules" label-width="80px"> | ||
| 198 | + <el-form-item label="参数名称" prop="configName"> | ||
| 199 | + <el-input v-model="form.configName" placeholder="请输入参数名称" /> | ||
| 200 | + </el-form-item> | ||
| 201 | + <el-form-item label="参数键名" prop="configKey"> | ||
| 202 | + <el-input v-model="form.configKey" placeholder="请输入参数键名" /> | ||
| 203 | + </el-form-item> | ||
| 204 | + <el-form-item label="参数键值" prop="configValue"> | ||
| 205 | + <el-input v-model="form.configValue" placeholder="请输入参数键值" /> | ||
| 206 | + </el-form-item> | ||
| 207 | + <el-form-item label="系统内置" prop="configType"> | ||
| 208 | + <el-radio-group v-model="form.configType"> | ||
| 209 | + <el-radio | ||
| 210 | + v-for="dict in sys_yes_no" | ||
| 211 | + :key="dict.value" | ||
| 212 | + :label="dict.value" | ||
| 213 | + >{{ dict.label }}</el-radio | ||
| 214 | + > | ||
| 215 | + </el-radio-group> | ||
| 216 | + </el-form-item> | ||
| 217 | + <el-form-item label="备注" prop="remark"> | ||
| 218 | + <el-input | ||
| 219 | + v-model="form.remark" | ||
| 220 | + type="textarea" | ||
| 221 | + placeholder="请输入内容" | ||
| 222 | + /> | ||
| 223 | + </el-form-item> | ||
| 224 | + </el-form> | ||
| 225 | + <template #footer> | ||
| 226 | + <div class="dialog-footer"> | ||
| 227 | + <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 228 | + <el-button @click="cancel">取 消</el-button> | ||
| 229 | + </div> | ||
| 230 | + </template> | ||
| 231 | + </el-dialog> | ||
| 232 | + </div> | ||
| 165 | </template> | 233 | </template> |
| 166 | 234 | ||
| 167 | <script setup name="Config"> | 235 | <script setup name="Config"> |
| 168 | -import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config"; | 236 | +import { |
| 237 | + listConfig, | ||
| 238 | + getConfig, | ||
| 239 | + delConfig, | ||
| 240 | + addConfig, | ||
| 241 | + updateConfig, | ||
| 242 | + refreshCache, | ||
| 243 | +} from "@/api/system/config"; | ||
| 169 | 244 | ||
| 170 | const { proxy } = getCurrentInstance(); | 245 | const { proxy } = getCurrentInstance(); |
| 171 | const { sys_yes_no } = proxy.useDict("sys_yes_no"); | 246 | const { sys_yes_no } = proxy.useDict("sys_yes_no"); |
| @@ -188,13 +263,19 @@ const data = reactive({ | @@ -188,13 +263,19 @@ const data = reactive({ | ||
| 188 | pageSize: 10, | 263 | pageSize: 10, |
| 189 | configName: undefined, | 264 | configName: undefined, |
| 190 | configKey: undefined, | 265 | configKey: undefined, |
| 191 | - configType: undefined | 266 | + configType: undefined, |
| 192 | }, | 267 | }, |
| 193 | rules: { | 268 | rules: { |
| 194 | - configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }], | ||
| 195 | - configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }], | ||
| 196 | - configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }] | ||
| 197 | - } | 269 | + configName: [ |
| 270 | + { required: true, message: "参数名称不能为空", trigger: "blur" }, | ||
| 271 | + ], | ||
| 272 | + configKey: [ | ||
| 273 | + { required: true, message: "参数键名不能为空", trigger: "blur" }, | ||
| 274 | + ], | ||
| 275 | + configValue: [ | ||
| 276 | + { required: true, message: "参数键值不能为空", trigger: "blur" }, | ||
| 277 | + ], | ||
| 278 | + }, | ||
| 198 | }); | 279 | }); |
| 199 | 280 | ||
| 200 | const { queryParams, form, rules } = toRefs(data); | 281 | const { queryParams, form, rules } = toRefs(data); |
| @@ -202,11 +283,13 @@ const { queryParams, form, rules } = toRefs(data); | @@ -202,11 +283,13 @@ const { queryParams, form, rules } = toRefs(data); | ||
| 202 | /** 查询参数列表 */ | 283 | /** 查询参数列表 */ |
| 203 | function getList() { | 284 | function getList() { |
| 204 | loading.value = true; | 285 | loading.value = true; |
| 205 | - listConfig(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { | ||
| 206 | - configList.value = response.rows; | ||
| 207 | - total.value = response.total; | ||
| 208 | - loading.value = false; | ||
| 209 | - }); | 286 | + listConfig(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 287 | + (response) => { | ||
| 288 | + configList.value = response.rows; | ||
| 289 | + total.value = response.total; | ||
| 290 | + loading.value = false; | ||
| 291 | + } | ||
| 292 | + ); | ||
| 210 | } | 293 | } |
| 211 | /** 取消按钮 */ | 294 | /** 取消按钮 */ |
| 212 | function cancel() { | 295 | function cancel() { |
| @@ -221,7 +304,7 @@ function reset() { | @@ -221,7 +304,7 @@ function reset() { | ||
| 221 | configKey: undefined, | 304 | configKey: undefined, |
| 222 | configValue: undefined, | 305 | configValue: undefined, |
| 223 | configType: "Y", | 306 | configType: "Y", |
| 224 | - remark: undefined | 307 | + remark: undefined, |
| 225 | }; | 308 | }; |
| 226 | proxy.resetForm("configRef"); | 309 | proxy.resetForm("configRef"); |
| 227 | } | 310 | } |
| @@ -238,7 +321,7 @@ function resetQuery() { | @@ -238,7 +321,7 @@ function resetQuery() { | ||
| 238 | } | 321 | } |
| 239 | /** 多选框选中数据 */ | 322 | /** 多选框选中数据 */ |
| 240 | function handleSelectionChange(selection) { | 323 | function handleSelectionChange(selection) { |
| 241 | - ids.value = selection.map(item => item.configId); | 324 | + ids.value = selection.map((item) => item.configId); |
| 242 | single.value = selection.length != 1; | 325 | single.value = selection.length != 1; |
| 243 | multiple.value = !selection.length; | 326 | multiple.value = !selection.length; |
| 244 | } | 327 | } |
| @@ -252,7 +335,7 @@ function handleAdd() { | @@ -252,7 +335,7 @@ function handleAdd() { | ||
| 252 | function handleUpdate(row) { | 335 | function handleUpdate(row) { |
| 253 | reset(); | 336 | reset(); |
| 254 | const configId = row.configId || ids.value; | 337 | const configId = row.configId || ids.value; |
| 255 | - getConfig(configId).then(response => { | 338 | + getConfig(configId).then((response) => { |
| 256 | form.value = response.data; | 339 | form.value = response.data; |
| 257 | open.value = true; | 340 | open.value = true; |
| 258 | title.value = "修改参数"; | 341 | title.value = "修改参数"; |
| @@ -260,16 +343,16 @@ function handleUpdate(row) { | @@ -260,16 +343,16 @@ function handleUpdate(row) { | ||
| 260 | } | 343 | } |
| 261 | /** 提交按钮 */ | 344 | /** 提交按钮 */ |
| 262 | function submitForm() { | 345 | function submitForm() { |
| 263 | - proxy.$refs["configRef"].validate(valid => { | 346 | + proxy.$refs["configRef"].validate((valid) => { |
| 264 | if (valid) { | 347 | if (valid) { |
| 265 | if (form.value.configId != undefined) { | 348 | if (form.value.configId != undefined) { |
| 266 | - updateConfig(form.value).then(response => { | 349 | + updateConfig(form.value).then((response) => { |
| 267 | proxy.$modal.msgSuccess("修改成功"); | 350 | proxy.$modal.msgSuccess("修改成功"); |
| 268 | open.value = false; | 351 | open.value = false; |
| 269 | getList(); | 352 | getList(); |
| 270 | }); | 353 | }); |
| 271 | } else { | 354 | } else { |
| 272 | - addConfig(form.value).then(response => { | 355 | + addConfig(form.value).then((response) => { |
| 273 | proxy.$modal.msgSuccess("新增成功"); | 356 | proxy.$modal.msgSuccess("新增成功"); |
| 274 | open.value = false; | 357 | open.value = false; |
| 275 | getList(); | 358 | getList(); |
| @@ -281,18 +364,26 @@ function submitForm() { | @@ -281,18 +364,26 @@ function submitForm() { | ||
| 281 | /** 删除按钮操作 */ | 364 | /** 删除按钮操作 */ |
| 282 | function handleDelete(row) { | 365 | function handleDelete(row) { |
| 283 | const configIds = row.configId || ids.value; | 366 | const configIds = row.configId || ids.value; |
| 284 | - proxy.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function () { | ||
| 285 | - return delConfig(configIds); | ||
| 286 | - }).then(() => { | ||
| 287 | - getList(); | ||
| 288 | - proxy.$modal.msgSuccess("删除成功"); | ||
| 289 | - }).catch(() => {}); | 367 | + proxy.$modal |
| 368 | + .confirm('是否确认删除参数编号为"' + configIds + '"的数据项?') | ||
| 369 | + .then(function () { | ||
| 370 | + return delConfig(configIds); | ||
| 371 | + }) | ||
| 372 | + .then(() => { | ||
| 373 | + getList(); | ||
| 374 | + proxy.$modal.msgSuccess("删除成功"); | ||
| 375 | + }) | ||
| 376 | + .catch(() => {}); | ||
| 290 | } | 377 | } |
| 291 | /** 导出按钮操作 */ | 378 | /** 导出按钮操作 */ |
| 292 | function handleExport() { | 379 | function handleExport() { |
| 293 | - proxy.download("system/config/export", { | ||
| 294 | - ...queryParams.value | ||
| 295 | - }, `config_${new Date().getTime()}.xlsx`); | 380 | + proxy.download( |
| 381 | + "system/config/export", | ||
| 382 | + { | ||
| 383 | + ...queryParams.value, | ||
| 384 | + }, | ||
| 385 | + `config_${new Date().getTime()}.xlsx` | ||
| 386 | + ); | ||
| 296 | } | 387 | } |
| 297 | /** 刷新缓存按钮操作 */ | 388 | /** 刷新缓存按钮操作 */ |
| 298 | function handleRefreshCache() { | 389 | function handleRefreshCache() { |
| 1 | <template> | 1 | <template> |
| 2 | - <div class="app-container"> | ||
| 3 | - <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> | ||
| 4 | - <el-form-item label="字典名称" prop="dictName"> | ||
| 5 | - <el-input | ||
| 6 | - v-model="queryParams.dictName" | ||
| 7 | - placeholder="请输入字典名称" | ||
| 8 | - clearable | ||
| 9 | - style="width: 240px" | ||
| 10 | - @keyup.enter="handleQuery" | ||
| 11 | - /> | ||
| 12 | - </el-form-item> | ||
| 13 | - <el-form-item label="字典类型" prop="dictType"> | ||
| 14 | - <el-input | ||
| 15 | - v-model="queryParams.dictType" | ||
| 16 | - placeholder="请输入字典类型" | ||
| 17 | - clearable | ||
| 18 | - style="width: 240px" | ||
| 19 | - @keyup.enter="handleQuery" | ||
| 20 | - /> | ||
| 21 | - </el-form-item> | ||
| 22 | - <el-form-item label="状态" prop="status"> | ||
| 23 | - <el-select | ||
| 24 | - v-model="queryParams.status" | ||
| 25 | - placeholder="字典状态" | ||
| 26 | - clearable | ||
| 27 | - style="width: 240px" | ||
| 28 | - > | ||
| 29 | - <el-option | ||
| 30 | - v-for="dict in sys_normal_disable" | ||
| 31 | - :key="dict.value" | ||
| 32 | - :label="dict.label" | ||
| 33 | - :value="dict.value" | ||
| 34 | - /> | ||
| 35 | - </el-select> | ||
| 36 | - </el-form-item> | ||
| 37 | - <el-form-item label="创建时间" style="width: 308px"> | ||
| 38 | - <el-date-picker | ||
| 39 | - v-model="dateRange" | ||
| 40 | - value-format="YYYY-MM-DD" | ||
| 41 | - type="daterange" | ||
| 42 | - range-separator="-" | ||
| 43 | - start-placeholder="开始日期" | ||
| 44 | - end-placeholder="结束日期" | ||
| 45 | - ></el-date-picker> | ||
| 46 | - </el-form-item> | ||
| 47 | - <el-form-item> | ||
| 48 | - <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||
| 49 | - <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||
| 50 | - </el-form-item> | ||
| 51 | - </el-form> | ||
| 52 | - | ||
| 53 | - <el-row :gutter="10" class="mb8"> | ||
| 54 | - <el-col :span="1.5"> | ||
| 55 | - <el-button | ||
| 56 | - type="primary" | ||
| 57 | - plain | ||
| 58 | - icon="Plus" | ||
| 59 | - @click="handleAdd" | ||
| 60 | - v-hasPermi="['system:dict:add']" | ||
| 61 | - >新增</el-button> | ||
| 62 | - </el-col> | ||
| 63 | - <el-col :span="1.5"> | ||
| 64 | - <el-button | ||
| 65 | - type="success" | ||
| 66 | - plain | ||
| 67 | - icon="Edit" | ||
| 68 | - :disabled="single" | ||
| 69 | - @click="handleUpdate" | ||
| 70 | - v-hasPermi="['system:dict:edit']" | ||
| 71 | - >修改</el-button> | ||
| 72 | - </el-col> | ||
| 73 | - <el-col :span="1.5"> | ||
| 74 | - <el-button | ||
| 75 | - type="danger" | ||
| 76 | - plain | ||
| 77 | - icon="Delete" | ||
| 78 | - :disabled="multiple" | ||
| 79 | - @click="handleDelete" | ||
| 80 | - v-hasPermi="['system:dict:remove']" | ||
| 81 | - >删除</el-button> | ||
| 82 | - </el-col> | ||
| 83 | - <el-col :span="1.5"> | ||
| 84 | - <el-button | ||
| 85 | - type="warning" | ||
| 86 | - plain | ||
| 87 | - icon="Download" | ||
| 88 | - @click="handleExport" | ||
| 89 | - v-hasPermi="['system:dict:export']" | ||
| 90 | - >导出</el-button> | ||
| 91 | - </el-col> | ||
| 92 | - <el-col :span="1.5"> | ||
| 93 | - <el-button | ||
| 94 | - type="danger" | ||
| 95 | - plain | ||
| 96 | - icon="Refresh" | ||
| 97 | - @click="handleRefreshCache" | ||
| 98 | - v-hasPermi="['system:dict:remove']" | ||
| 99 | - >刷新缓存</el-button> | ||
| 100 | - </el-col> | ||
| 101 | - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||
| 102 | - </el-row> | 2 | + <div class="app-container"> |
| 3 | + <el-form | ||
| 4 | + :model="queryParams" | ||
| 5 | + ref="queryRef" | ||
| 6 | + :inline="true" | ||
| 7 | + v-show="showSearch" | ||
| 8 | + label-width="80px" | ||
| 9 | + > | ||
| 10 | + <el-form-item label="字典名称" prop="dictName"> | ||
| 11 | + <el-input | ||
| 12 | + v-model="queryParams.dictName" | ||
| 13 | + placeholder="请输入字典名称" | ||
| 14 | + clearable | ||
| 15 | + style="width: 240px" | ||
| 16 | + @keyup.enter="handleQuery" | ||
| 17 | + /> | ||
| 18 | + </el-form-item> | ||
| 19 | + <el-form-item label="字典类型" prop="dictType"> | ||
| 20 | + <el-input | ||
| 21 | + v-model="queryParams.dictType" | ||
| 22 | + placeholder="请输入字典类型" | ||
| 23 | + clearable | ||
| 24 | + style="width: 240px" | ||
| 25 | + @keyup.enter="handleQuery" | ||
| 26 | + /> | ||
| 27 | + </el-form-item> | ||
| 28 | + <el-form-item label="状态" prop="status"> | ||
| 29 | + <el-select | ||
| 30 | + v-model="queryParams.status" | ||
| 31 | + placeholder="字典状态" | ||
| 32 | + clearable | ||
| 33 | + style="width: 240px" | ||
| 34 | + > | ||
| 35 | + <el-option | ||
| 36 | + v-for="dict in sys_normal_disable" | ||
| 37 | + :key="dict.value" | ||
| 38 | + :label="dict.label" | ||
| 39 | + :value="dict.value" | ||
| 40 | + /> | ||
| 41 | + </el-select> | ||
| 42 | + </el-form-item> | ||
| 43 | + <el-form-item label="创建时间" style="width: 308px"> | ||
| 44 | + <el-date-picker | ||
| 45 | + v-model="dateRange" | ||
| 46 | + value-format="YYYY-MM-DD" | ||
| 47 | + type="daterange" | ||
| 48 | + range-separator="-" | ||
| 49 | + start-placeholder="开始日期" | ||
| 50 | + end-placeholder="结束日期" | ||
| 51 | + ></el-date-picker> | ||
| 52 | + </el-form-item> | ||
| 53 | + <el-form-item> | ||
| 54 | + <el-button type="primary" icon="Search" @click="handleQuery" | ||
| 55 | + >搜索</el-button | ||
| 56 | + > | ||
| 57 | + <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||
| 58 | + </el-form-item> | ||
| 59 | + </el-form> | ||
| 103 | 60 | ||
| 104 | - <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> | ||
| 105 | - <el-table-column type="selection" width="55" align="center" /> | ||
| 106 | - <el-table-column label="字典编号" align="center" prop="dictId" /> | ||
| 107 | - <el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/> | ||
| 108 | - <el-table-column label="字典类型" align="center" :show-overflow-tooltip="true"> | ||
| 109 | - <template #default="scope"> | ||
| 110 | - <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> | ||
| 111 | - <span>{{ scope.row.dictType }}</span> | ||
| 112 | - </router-link> | ||
| 113 | - </template> | ||
| 114 | - </el-table-column> | ||
| 115 | - <el-table-column label="状态" align="center" prop="status"> | ||
| 116 | - <template #default="scope"> | ||
| 117 | - <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> | ||
| 118 | - </template> | ||
| 119 | - </el-table-column> | ||
| 120 | - <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> | ||
| 121 | - <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | ||
| 122 | - <template #default="scope"> | ||
| 123 | - <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 124 | - </template> | ||
| 125 | - </el-table-column> | ||
| 126 | - <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> | ||
| 127 | - <template #default="scope"> | ||
| 128 | - <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button> | ||
| 129 | - <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button> | ||
| 130 | - </template> | ||
| 131 | - </el-table-column> | ||
| 132 | - </el-table> | 61 | + <el-row :gutter="10" class="mb8"> |
| 62 | + <el-col :span="1.5"> | ||
| 63 | + <el-button | ||
| 64 | + type="primary" | ||
| 65 | + plain | ||
| 66 | + icon="Plus" | ||
| 67 | + @click="handleAdd" | ||
| 68 | + v-hasPermi="['system:dict:add']" | ||
| 69 | + >新增</el-button | ||
| 70 | + > | ||
| 71 | + </el-col> | ||
| 72 | + <el-col :span="1.5"> | ||
| 73 | + <el-button | ||
| 74 | + type="success" | ||
| 75 | + plain | ||
| 76 | + icon="Edit" | ||
| 77 | + :disabled="single" | ||
| 78 | + @click="handleUpdate" | ||
| 79 | + v-hasPermi="['system:dict:edit']" | ||
| 80 | + >修改</el-button | ||
| 81 | + > | ||
| 82 | + </el-col> | ||
| 83 | + <el-col :span="1.5"> | ||
| 84 | + <el-button | ||
| 85 | + type="danger" | ||
| 86 | + plain | ||
| 87 | + icon="Delete" | ||
| 88 | + :disabled="multiple" | ||
| 89 | + @click="handleDelete" | ||
| 90 | + v-hasPermi="['system:dict:remove']" | ||
| 91 | + >删除</el-button | ||
| 92 | + > | ||
| 93 | + </el-col> | ||
| 94 | + <el-col :span="1.5"> | ||
| 95 | + <el-button | ||
| 96 | + type="warning" | ||
| 97 | + plain | ||
| 98 | + icon="Download" | ||
| 99 | + @click="handleExport" | ||
| 100 | + v-hasPermi="['system:dict:export']" | ||
| 101 | + >导出</el-button | ||
| 102 | + > | ||
| 103 | + </el-col> | ||
| 104 | + <el-col :span="1.5"> | ||
| 105 | + <el-button | ||
| 106 | + type="danger" | ||
| 107 | + plain | ||
| 108 | + icon="Refresh" | ||
| 109 | + @click="handleRefreshCache" | ||
| 110 | + v-hasPermi="['system:dict:remove']" | ||
| 111 | + >刷新缓存</el-button | ||
| 112 | + > | ||
| 113 | + </el-col> | ||
| 114 | + <right-toolbar | ||
| 115 | + v-model:showSearch="showSearch" | ||
| 116 | + @queryTable="getList" | ||
| 117 | + ></right-toolbar> | ||
| 118 | + </el-row> | ||
| 133 | 119 | ||
| 134 | - <pagination | ||
| 135 | - v-show="total > 0" | ||
| 136 | - :total="total" | ||
| 137 | - v-model:page="queryParams.pageNum" | ||
| 138 | - v-model:limit="queryParams.pageSize" | ||
| 139 | - @pagination="getList" | 120 | + <el-table |
| 121 | + v-loading="loading" | ||
| 122 | + :data="typeList" | ||
| 123 | + @selection-change="handleSelectionChange" | ||
| 124 | + > | ||
| 125 | + <el-table-column type="selection" width="55" align="center" /> | ||
| 126 | + <el-table-column label="字典编号" align="center" prop="dictId" /> | ||
| 127 | + <el-table-column | ||
| 128 | + label="字典名称" | ||
| 129 | + align="center" | ||
| 130 | + prop="dictName" | ||
| 131 | + :show-overflow-tooltip="true" | ||
| 140 | /> | 132 | /> |
| 133 | + <el-table-column | ||
| 134 | + label="字典类型" | ||
| 135 | + align="center" | ||
| 136 | + :show-overflow-tooltip="true" | ||
| 137 | + > | ||
| 138 | + <template #default="scope"> | ||
| 139 | + <router-link | ||
| 140 | + :to="'/system/dict-data/index/' + scope.row.dictId" | ||
| 141 | + class="link-type" | ||
| 142 | + > | ||
| 143 | + <span>{{ scope.row.dictType }}</span> | ||
| 144 | + </router-link> | ||
| 145 | + </template> | ||
| 146 | + </el-table-column> | ||
| 147 | + <el-table-column label="状态" align="center" prop="status"> | ||
| 148 | + <template #default="scope"> | ||
| 149 | + <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> | ||
| 150 | + </template> | ||
| 151 | + </el-table-column> | ||
| 152 | + <el-table-column | ||
| 153 | + label="备注" | ||
| 154 | + align="center" | ||
| 155 | + prop="remark" | ||
| 156 | + :show-overflow-tooltip="true" | ||
| 157 | + /> | ||
| 158 | + <el-table-column | ||
| 159 | + label="创建时间" | ||
| 160 | + align="center" | ||
| 161 | + prop="createTime" | ||
| 162 | + width="180" | ||
| 163 | + > | ||
| 164 | + <template #default="scope"> | ||
| 165 | + <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 166 | + </template> | ||
| 167 | + </el-table-column> | ||
| 168 | + <el-table-column | ||
| 169 | + label="操作" | ||
| 170 | + align="center" | ||
| 171 | + width="160" | ||
| 172 | + class-name="small-padding fixed-width" | ||
| 173 | + > | ||
| 174 | + <template #default="scope"> | ||
| 175 | + <el-button | ||
| 176 | + link | ||
| 177 | + type="primary" | ||
| 178 | + icon="Edit" | ||
| 179 | + @click="handleUpdate(scope.row)" | ||
| 180 | + v-hasPermi="['system:dict:edit']" | ||
| 181 | + >修改</el-button | ||
| 182 | + > | ||
| 183 | + <el-button | ||
| 184 | + link | ||
| 185 | + type="primary" | ||
| 186 | + icon="Delete" | ||
| 187 | + @click="handleDelete(scope.row)" | ||
| 188 | + v-hasPermi="['system:dict:remove']" | ||
| 189 | + >删除</el-button | ||
| 190 | + > | ||
| 191 | + </template> | ||
| 192 | + </el-table-column> | ||
| 193 | + </el-table> | ||
| 194 | + | ||
| 195 | + <pagination | ||
| 196 | + v-show="total > 0" | ||
| 197 | + :total="total" | ||
| 198 | + v-model:page="queryParams.pageNum" | ||
| 199 | + v-model:limit="queryParams.pageSize" | ||
| 200 | + @pagination="getList" | ||
| 201 | + /> | ||
| 141 | 202 | ||
| 142 | - <!-- 添加或修改参数配置对话框 --> | ||
| 143 | - <el-dialog :title="title" v-model="open" width="500px" append-to-body> | ||
| 144 | - <el-form ref="dictRef" :model="form" :rules="rules" label-width="80px"> | ||
| 145 | - <el-form-item label="字典名称" prop="dictName"> | ||
| 146 | - <el-input v-model="form.dictName" placeholder="请输入字典名称" /> | ||
| 147 | - </el-form-item> | ||
| 148 | - <el-form-item label="字典类型" prop="dictType"> | ||
| 149 | - <el-input v-model="form.dictType" placeholder="请输入字典类型" /> | ||
| 150 | - </el-form-item> | ||
| 151 | - <el-form-item label="状态" prop="status"> | ||
| 152 | - <el-radio-group v-model="form.status"> | ||
| 153 | - <el-radio | ||
| 154 | - v-for="dict in sys_normal_disable" | ||
| 155 | - :key="dict.value" | ||
| 156 | - :label="dict.value" | ||
| 157 | - >{{ dict.label }}</el-radio> | ||
| 158 | - </el-radio-group> | ||
| 159 | - </el-form-item> | ||
| 160 | - <el-form-item label="备注" prop="remark"> | ||
| 161 | - <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> | ||
| 162 | - </el-form-item> | ||
| 163 | - </el-form> | ||
| 164 | - <template #footer> | ||
| 165 | - <div class="dialog-footer"> | ||
| 166 | - <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 167 | - <el-button @click="cancel">取 消</el-button> | ||
| 168 | - </div> | ||
| 169 | - </template> | ||
| 170 | - </el-dialog> | ||
| 171 | - </div> | 203 | + <!-- 添加或修改参数配置对话框 --> |
| 204 | + <el-dialog :title="title" v-model="open" width="500px" append-to-body> | ||
| 205 | + <el-form ref="dictRef" :model="form" :rules="rules" label-width="80px"> | ||
| 206 | + <el-form-item label="字典名称" prop="dictName"> | ||
| 207 | + <el-input v-model="form.dictName" placeholder="请输入字典名称" /> | ||
| 208 | + </el-form-item> | ||
| 209 | + <el-form-item label="字典类型" prop="dictType"> | ||
| 210 | + <el-input v-model="form.dictType" placeholder="请输入字典类型" /> | ||
| 211 | + </el-form-item> | ||
| 212 | + <el-form-item label="状态" prop="status"> | ||
| 213 | + <el-radio-group v-model="form.status"> | ||
| 214 | + <el-radio | ||
| 215 | + v-for="dict in sys_normal_disable" | ||
| 216 | + :key="dict.value" | ||
| 217 | + :label="dict.value" | ||
| 218 | + >{{ dict.label }}</el-radio | ||
| 219 | + > | ||
| 220 | + </el-radio-group> | ||
| 221 | + </el-form-item> | ||
| 222 | + <el-form-item label="备注" prop="remark"> | ||
| 223 | + <el-input | ||
| 224 | + v-model="form.remark" | ||
| 225 | + type="textarea" | ||
| 226 | + placeholder="请输入内容" | ||
| 227 | + ></el-input> | ||
| 228 | + </el-form-item> | ||
| 229 | + </el-form> | ||
| 230 | + <template #footer> | ||
| 231 | + <div class="dialog-footer"> | ||
| 232 | + <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 233 | + <el-button @click="cancel">取 消</el-button> | ||
| 234 | + </div> | ||
| 235 | + </template> | ||
| 236 | + </el-dialog> | ||
| 237 | + </div> | ||
| 172 | </template> | 238 | </template> |
| 173 | 239 | ||
| 174 | <script setup name="Dict"> | 240 | <script setup name="Dict"> |
| 175 | -import useDictStore from '@/store/modules/dict' | ||
| 176 | -import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; | 241 | +import useDictStore from "@/store/modules/dict"; |
| 242 | +import { | ||
| 243 | + listType, | ||
| 244 | + getType, | ||
| 245 | + delType, | ||
| 246 | + addType, | ||
| 247 | + updateType, | ||
| 248 | + refreshCache, | ||
| 249 | +} from "@/api/system/dict/type"; | ||
| 177 | 250 | ||
| 178 | const { proxy } = getCurrentInstance(); | 251 | const { proxy } = getCurrentInstance(); |
| 179 | const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); | 252 | const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); |
| @@ -196,11 +269,15 @@ const data = reactive({ | @@ -196,11 +269,15 @@ const data = reactive({ | ||
| 196 | pageSize: 10, | 269 | pageSize: 10, |
| 197 | dictName: undefined, | 270 | dictName: undefined, |
| 198 | dictType: undefined, | 271 | dictType: undefined, |
| 199 | - status: undefined | 272 | + status: undefined, |
| 200 | }, | 273 | }, |
| 201 | rules: { | 274 | rules: { |
| 202 | - dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }], | ||
| 203 | - dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }] | 275 | + dictName: [ |
| 276 | + { required: true, message: "字典名称不能为空", trigger: "blur" }, | ||
| 277 | + ], | ||
| 278 | + dictType: [ | ||
| 279 | + { required: true, message: "字典类型不能为空", trigger: "blur" }, | ||
| 280 | + ], | ||
| 204 | }, | 281 | }, |
| 205 | }); | 282 | }); |
| 206 | 283 | ||
| @@ -209,11 +286,13 @@ const { queryParams, form, rules } = toRefs(data); | @@ -209,11 +286,13 @@ const { queryParams, form, rules } = toRefs(data); | ||
| 209 | /** 查询字典类型列表 */ | 286 | /** 查询字典类型列表 */ |
| 210 | function getList() { | 287 | function getList() { |
| 211 | loading.value = true; | 288 | loading.value = true; |
| 212 | - listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { | ||
| 213 | - typeList.value = response.rows; | ||
| 214 | - total.value = response.total; | ||
| 215 | - loading.value = false; | ||
| 216 | - }); | 289 | + listType(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 290 | + (response) => { | ||
| 291 | + typeList.value = response.rows; | ||
| 292 | + total.value = response.total; | ||
| 293 | + loading.value = false; | ||
| 294 | + } | ||
| 295 | + ); | ||
| 217 | } | 296 | } |
| 218 | /** 取消按钮 */ | 297 | /** 取消按钮 */ |
| 219 | function cancel() { | 298 | function cancel() { |
| @@ -227,7 +306,7 @@ function reset() { | @@ -227,7 +306,7 @@ function reset() { | ||
| 227 | dictName: undefined, | 306 | dictName: undefined, |
| 228 | dictType: undefined, | 307 | dictType: undefined, |
| 229 | status: "0", | 308 | status: "0", |
| 230 | - remark: undefined | 309 | + remark: undefined, |
| 231 | }; | 310 | }; |
| 232 | proxy.resetForm("dictRef"); | 311 | proxy.resetForm("dictRef"); |
| 233 | } | 312 | } |
| @@ -250,7 +329,7 @@ function handleAdd() { | @@ -250,7 +329,7 @@ function handleAdd() { | ||
| 250 | } | 329 | } |
| 251 | /** 多选框选中数据 */ | 330 | /** 多选框选中数据 */ |
| 252 | function handleSelectionChange(selection) { | 331 | function handleSelectionChange(selection) { |
| 253 | - ids.value = selection.map(item => item.dictId); | 332 | + ids.value = selection.map((item) => item.dictId); |
| 254 | single.value = selection.length != 1; | 333 | single.value = selection.length != 1; |
| 255 | multiple.value = !selection.length; | 334 | multiple.value = !selection.length; |
| 256 | } | 335 | } |
| @@ -258,7 +337,7 @@ function handleSelectionChange(selection) { | @@ -258,7 +337,7 @@ function handleSelectionChange(selection) { | ||
| 258 | function handleUpdate(row) { | 337 | function handleUpdate(row) { |
| 259 | reset(); | 338 | reset(); |
| 260 | const dictId = row.dictId || ids.value; | 339 | const dictId = row.dictId || ids.value; |
| 261 | - getType(dictId).then(response => { | 340 | + getType(dictId).then((response) => { |
| 262 | form.value = response.data; | 341 | form.value = response.data; |
| 263 | open.value = true; | 342 | open.value = true; |
| 264 | title.value = "修改字典类型"; | 343 | title.value = "修改字典类型"; |
| @@ -266,16 +345,16 @@ function handleUpdate(row) { | @@ -266,16 +345,16 @@ function handleUpdate(row) { | ||
| 266 | } | 345 | } |
| 267 | /** 提交按钮 */ | 346 | /** 提交按钮 */ |
| 268 | function submitForm() { | 347 | function submitForm() { |
| 269 | - proxy.$refs["dictRef"].validate(valid => { | 348 | + proxy.$refs["dictRef"].validate((valid) => { |
| 270 | if (valid) { | 349 | if (valid) { |
| 271 | if (form.value.dictId != undefined) { | 350 | if (form.value.dictId != undefined) { |
| 272 | - updateType(form.value).then(response => { | 351 | + updateType(form.value).then((response) => { |
| 273 | proxy.$modal.msgSuccess("修改成功"); | 352 | proxy.$modal.msgSuccess("修改成功"); |
| 274 | open.value = false; | 353 | open.value = false; |
| 275 | getList(); | 354 | getList(); |
| 276 | }); | 355 | }); |
| 277 | } else { | 356 | } else { |
| 278 | - addType(form.value).then(response => { | 357 | + addType(form.value).then((response) => { |
| 279 | proxy.$modal.msgSuccess("新增成功"); | 358 | proxy.$modal.msgSuccess("新增成功"); |
| 280 | open.value = false; | 359 | open.value = false; |
| 281 | getList(); | 360 | getList(); |
| @@ -287,18 +366,26 @@ function submitForm() { | @@ -287,18 +366,26 @@ function submitForm() { | ||
| 287 | /** 删除按钮操作 */ | 366 | /** 删除按钮操作 */ |
| 288 | function handleDelete(row) { | 367 | function handleDelete(row) { |
| 289 | const dictIds = row.dictId || ids.value; | 368 | const dictIds = row.dictId || ids.value; |
| 290 | - proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { | ||
| 291 | - return delType(dictIds); | ||
| 292 | - }).then(() => { | ||
| 293 | - getList(); | ||
| 294 | - proxy.$modal.msgSuccess("删除成功"); | ||
| 295 | - }).catch(() => {}); | 369 | + proxy.$modal |
| 370 | + .confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?') | ||
| 371 | + .then(function () { | ||
| 372 | + return delType(dictIds); | ||
| 373 | + }) | ||
| 374 | + .then(() => { | ||
| 375 | + getList(); | ||
| 376 | + proxy.$modal.msgSuccess("删除成功"); | ||
| 377 | + }) | ||
| 378 | + .catch(() => {}); | ||
| 296 | } | 379 | } |
| 297 | /** 导出按钮操作 */ | 380 | /** 导出按钮操作 */ |
| 298 | function handleExport() { | 381 | function handleExport() { |
| 299 | - proxy.download("system/dict/type/export", { | ||
| 300 | - ...queryParams.value | ||
| 301 | - }, `dict_${new Date().getTime()}.xlsx`); | 382 | + proxy.download( |
| 383 | + "system/dict/type/export", | ||
| 384 | + { | ||
| 385 | + ...queryParams.value, | ||
| 386 | + }, | ||
| 387 | + `dict_${new Date().getTime()}.xlsx` | ||
| 388 | + ); | ||
| 302 | } | 389 | } |
| 303 | /** 刷新缓存按钮操作 */ | 390 | /** 刷新缓存按钮操作 */ |
| 304 | function handleRefreshCache() { | 391 | function handleRefreshCache() { |
| 1 | <template> | 1 | <template> |
| 2 | - <div class="app-container"> | ||
| 3 | - <el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px"> | ||
| 4 | - <el-form-item label="角色名称" prop="roleName"> | ||
| 5 | - <el-input | ||
| 6 | - v-model="queryParams.roleName" | ||
| 7 | - placeholder="请输入角色名称" | ||
| 8 | - clearable | ||
| 9 | - style="width: 240px" | ||
| 10 | - @keyup.enter="handleQuery" | ||
| 11 | - /> | ||
| 12 | - </el-form-item> | ||
| 13 | - <el-form-item label="权限字符" prop="roleKey"> | ||
| 14 | - <el-input | ||
| 15 | - v-model="queryParams.roleKey" | ||
| 16 | - placeholder="请输入权限字符" | ||
| 17 | - clearable | ||
| 18 | - style="width: 240px" | ||
| 19 | - @keyup.enter="handleQuery" | ||
| 20 | - /> | ||
| 21 | - </el-form-item> | ||
| 22 | - <el-form-item label="状态" prop="status"> | ||
| 23 | - <el-select | ||
| 24 | - v-model="queryParams.status" | ||
| 25 | - placeholder="角色状态" | ||
| 26 | - clearable | ||
| 27 | - style="width: 240px" | ||
| 28 | - > | ||
| 29 | - <el-option | ||
| 30 | - v-for="dict in sys_normal_disable" | ||
| 31 | - :key="dict.value" | ||
| 32 | - :label="dict.label" | ||
| 33 | - :value="dict.value" | ||
| 34 | - /> | ||
| 35 | - </el-select> | ||
| 36 | - </el-form-item> | ||
| 37 | - <el-form-item label="创建时间" style="width: 308px"> | ||
| 38 | - <el-date-picker | ||
| 39 | - v-model="dateRange" | ||
| 40 | - value-format="YYYY-MM-DD" | ||
| 41 | - type="daterange" | ||
| 42 | - range-separator="-" | ||
| 43 | - start-placeholder="开始日期" | ||
| 44 | - end-placeholder="结束日期" | ||
| 45 | - ></el-date-picker> | ||
| 46 | - </el-form-item> | ||
| 47 | - <el-form-item> | ||
| 48 | - <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||
| 49 | - <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||
| 50 | - </el-form-item> | ||
| 51 | - </el-form> | ||
| 52 | - <el-row :gutter="10" class="mb8"> | ||
| 53 | - <el-col :span="1.5"> | 2 | + <div class="app-container"> |
| 3 | + <el-form | ||
| 4 | + :model="queryParams" | ||
| 5 | + ref="queryRef" | ||
| 6 | + v-show="showSearch" | ||
| 7 | + :inline="true" | ||
| 8 | + label-width="80px" | ||
| 9 | + > | ||
| 10 | + <el-form-item label="角色名称" prop="roleName"> | ||
| 11 | + <el-input | ||
| 12 | + v-model="queryParams.roleName" | ||
| 13 | + placeholder="请输入角色名称" | ||
| 14 | + clearable | ||
| 15 | + style="width: 240px" | ||
| 16 | + @keyup.enter="handleQuery" | ||
| 17 | + /> | ||
| 18 | + </el-form-item> | ||
| 19 | + <el-form-item label="权限字符" prop="roleKey"> | ||
| 20 | + <el-input | ||
| 21 | + v-model="queryParams.roleKey" | ||
| 22 | + placeholder="请输入权限字符" | ||
| 23 | + clearable | ||
| 24 | + style="width: 240px" | ||
| 25 | + @keyup.enter="handleQuery" | ||
| 26 | + /> | ||
| 27 | + </el-form-item> | ||
| 28 | + <el-form-item label="状态" prop="status"> | ||
| 29 | + <el-select | ||
| 30 | + v-model="queryParams.status" | ||
| 31 | + placeholder="角色状态" | ||
| 32 | + clearable | ||
| 33 | + style="width: 240px" | ||
| 34 | + > | ||
| 35 | + <el-option | ||
| 36 | + v-for="dict in sys_normal_disable" | ||
| 37 | + :key="dict.value" | ||
| 38 | + :label="dict.label" | ||
| 39 | + :value="dict.value" | ||
| 40 | + /> | ||
| 41 | + </el-select> | ||
| 42 | + </el-form-item> | ||
| 43 | + <el-form-item label="创建时间" style="width: 308px"> | ||
| 44 | + <el-date-picker | ||
| 45 | + v-model="dateRange" | ||
| 46 | + value-format="YYYY-MM-DD" | ||
| 47 | + type="daterange" | ||
| 48 | + range-separator="-" | ||
| 49 | + start-placeholder="开始日期" | ||
| 50 | + end-placeholder="结束日期" | ||
| 51 | + ></el-date-picker> | ||
| 52 | + </el-form-item> | ||
| 53 | + <el-form-item> | ||
| 54 | + <el-button type="primary" icon="Search" @click="handleQuery" | ||
| 55 | + >搜索</el-button | ||
| 56 | + > | ||
| 57 | + <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||
| 58 | + </el-form-item> | ||
| 59 | + </el-form> | ||
| 60 | + <el-row :gutter="10" class="mb8"> | ||
| 61 | + <el-col :span="1.5"> | ||
| 62 | + <el-button | ||
| 63 | + type="primary" | ||
| 64 | + plain | ||
| 65 | + icon="Plus" | ||
| 66 | + @click="handleAdd" | ||
| 67 | + v-hasPermi="['system:role:add']" | ||
| 68 | + >新增</el-button | ||
| 69 | + > | ||
| 70 | + </el-col> | ||
| 71 | + <el-col :span="1.5"> | ||
| 72 | + <el-button | ||
| 73 | + type="success" | ||
| 74 | + plain | ||
| 75 | + icon="Edit" | ||
| 76 | + :disabled="single" | ||
| 77 | + @click="handleUpdate" | ||
| 78 | + v-hasPermi="['system:role:edit']" | ||
| 79 | + >修改</el-button | ||
| 80 | + > | ||
| 81 | + </el-col> | ||
| 82 | + <el-col :span="1.5"> | ||
| 83 | + <el-button | ||
| 84 | + type="danger" | ||
| 85 | + plain | ||
| 86 | + icon="Delete" | ||
| 87 | + :disabled="multiple" | ||
| 88 | + @click="handleDelete" | ||
| 89 | + v-hasPermi="['system:role:remove']" | ||
| 90 | + >删除</el-button | ||
| 91 | + > | ||
| 92 | + </el-col> | ||
| 93 | + <el-col :span="1.5"> | ||
| 94 | + <el-button | ||
| 95 | + type="warning" | ||
| 96 | + plain | ||
| 97 | + icon="Download" | ||
| 98 | + @click="handleExport" | ||
| 99 | + v-hasPermi="['system:role:export']" | ||
| 100 | + >导出</el-button | ||
| 101 | + > | ||
| 102 | + </el-col> | ||
| 103 | + <right-toolbar | ||
| 104 | + v-model:showSearch="showSearch" | ||
| 105 | + @queryTable="getList" | ||
| 106 | + ></right-toolbar> | ||
| 107 | + </el-row> | ||
| 108 | + | ||
| 109 | + <!-- 表格数据 --> | ||
| 110 | + <el-table | ||
| 111 | + v-loading="loading" | ||
| 112 | + :data="roleList" | ||
| 113 | + @selection-change="handleSelectionChange" | ||
| 114 | + > | ||
| 115 | + <el-table-column type="selection" width="55" align="center" /> | ||
| 116 | + <el-table-column label="角色编号" prop="roleId" width="120" /> | ||
| 117 | + <el-table-column | ||
| 118 | + label="角色名称" | ||
| 119 | + prop="roleName" | ||
| 120 | + :show-overflow-tooltip="true" | ||
| 121 | + width="150" | ||
| 122 | + /> | ||
| 123 | + <el-table-column | ||
| 124 | + label="权限字符" | ||
| 125 | + prop="roleKey" | ||
| 126 | + :show-overflow-tooltip="true" | ||
| 127 | + width="150" | ||
| 128 | + /> | ||
| 129 | + <el-table-column label="显示顺序" prop="roleSort" width="100" /> | ||
| 130 | + <el-table-column label="状态" align="center" width="100"> | ||
| 131 | + <template #default="scope"> | ||
| 132 | + <el-switch | ||
| 133 | + v-model="scope.row.status" | ||
| 134 | + active-value="0" | ||
| 135 | + inactive-value="1" | ||
| 136 | + @change="handleStatusChange(scope.row)" | ||
| 137 | + ></el-switch> | ||
| 138 | + </template> | ||
| 139 | + </el-table-column> | ||
| 140 | + <el-table-column label="创建时间" align="center" prop="createTime"> | ||
| 141 | + <template #default="scope"> | ||
| 142 | + <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 143 | + </template> | ||
| 144 | + </el-table-column> | ||
| 145 | + <el-table-column | ||
| 146 | + label="操作" | ||
| 147 | + align="center" | ||
| 148 | + class-name="small-padding fixed-width" | ||
| 149 | + > | ||
| 150 | + <template #default="scope"> | ||
| 151 | + <el-tooltip | ||
| 152 | + content="修改" | ||
| 153 | + placement="top" | ||
| 154 | + v-if="scope.row.roleId !== 1" | ||
| 155 | + > | ||
| 54 | <el-button | 156 | <el-button |
| 55 | - type="primary" | ||
| 56 | - plain | ||
| 57 | - icon="Plus" | ||
| 58 | - @click="handleAdd" | ||
| 59 | - v-hasPermi="['system:role:add']" | ||
| 60 | - >新增</el-button> | ||
| 61 | - </el-col> | ||
| 62 | - <el-col :span="1.5"> | 157 | + link |
| 158 | + type="primary" | ||
| 159 | + icon="Edit" | ||
| 160 | + @click="handleUpdate(scope.row)" | ||
| 161 | + v-hasPermi="['system:role:edit']" | ||
| 162 | + ></el-button> | ||
| 163 | + </el-tooltip> | ||
| 164 | + <el-tooltip | ||
| 165 | + content="删除" | ||
| 166 | + placement="top" | ||
| 167 | + v-if="scope.row.roleId !== 1" | ||
| 168 | + > | ||
| 63 | <el-button | 169 | <el-button |
| 64 | - type="success" | ||
| 65 | - plain | ||
| 66 | - icon="Edit" | ||
| 67 | - :disabled="single" | ||
| 68 | - @click="handleUpdate" | ||
| 69 | - v-hasPermi="['system:role:edit']" | ||
| 70 | - >修改</el-button> | ||
| 71 | - </el-col> | ||
| 72 | - <el-col :span="1.5"> | 170 | + link |
| 171 | + type="primary" | ||
| 172 | + icon="Delete" | ||
| 173 | + @click="handleDelete(scope.row)" | ||
| 174 | + v-hasPermi="['system:role:remove']" | ||
| 175 | + ></el-button> | ||
| 176 | + </el-tooltip> | ||
| 177 | + <el-tooltip | ||
| 178 | + content="数据权限" | ||
| 179 | + placement="top" | ||
| 180 | + v-if="scope.row.roleId !== 1" | ||
| 181 | + > | ||
| 73 | <el-button | 182 | <el-button |
| 74 | - type="danger" | ||
| 75 | - plain | ||
| 76 | - icon="Delete" | ||
| 77 | - :disabled="multiple" | ||
| 78 | - @click="handleDelete" | ||
| 79 | - v-hasPermi="['system:role:remove']" | ||
| 80 | - >删除</el-button> | ||
| 81 | - </el-col> | ||
| 82 | - <el-col :span="1.5"> | 183 | + link |
| 184 | + type="primary" | ||
| 185 | + icon="CircleCheck" | ||
| 186 | + @click="handleDataScope(scope.row)" | ||
| 187 | + v-hasPermi="['system:role:edit']" | ||
| 188 | + ></el-button> | ||
| 189 | + </el-tooltip> | ||
| 190 | + <el-tooltip | ||
| 191 | + content="分配用户" | ||
| 192 | + placement="top" | ||
| 193 | + v-if="scope.row.roleId !== 1" | ||
| 194 | + > | ||
| 83 | <el-button | 195 | <el-button |
| 84 | - type="warning" | ||
| 85 | - plain | ||
| 86 | - icon="Download" | ||
| 87 | - @click="handleExport" | ||
| 88 | - v-hasPermi="['system:role:export']" | ||
| 89 | - >导出</el-button> | ||
| 90 | - </el-col> | ||
| 91 | - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||
| 92 | - </el-row> | ||
| 93 | - | ||
| 94 | - <!-- 表格数据 --> | ||
| 95 | - <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"> | ||
| 96 | - <el-table-column type="selection" width="55" align="center" /> | ||
| 97 | - <el-table-column label="角色编号" prop="roleId" width="120" /> | ||
| 98 | - <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> | ||
| 99 | - <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> | ||
| 100 | - <el-table-column label="显示顺序" prop="roleSort" width="100" /> | ||
| 101 | - <el-table-column label="状态" align="center" width="100"> | ||
| 102 | - <template #default="scope"> | ||
| 103 | - <el-switch | ||
| 104 | - v-model="scope.row.status" | ||
| 105 | - active-value="0" | ||
| 106 | - inactive-value="1" | ||
| 107 | - @change="handleStatusChange(scope.row)" | ||
| 108 | - ></el-switch> | ||
| 109 | - </template> | ||
| 110 | - </el-table-column> | ||
| 111 | - <el-table-column label="创建时间" align="center" prop="createTime"> | ||
| 112 | - <template #default="scope"> | ||
| 113 | - <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 114 | - </template> | ||
| 115 | - </el-table-column> | ||
| 116 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||
| 117 | - <template #default="scope"> | ||
| 118 | - <el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1"> | ||
| 119 | - <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']"></el-button> | ||
| 120 | - </el-tooltip> | ||
| 121 | - <el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1"> | ||
| 122 | - <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']"></el-button> | ||
| 123 | - </el-tooltip> | ||
| 124 | - <el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1"> | ||
| 125 | - <el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)" v-hasPermi="['system:role:edit']"></el-button> | ||
| 126 | - </el-tooltip> | ||
| 127 | - <el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1"> | ||
| 128 | - <el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']"></el-button> | ||
| 129 | - </el-tooltip> | ||
| 130 | - </template> | ||
| 131 | - </el-table-column> | ||
| 132 | - </el-table> | 196 | + link |
| 197 | + type="primary" | ||
| 198 | + icon="User" | ||
| 199 | + @click="handleAuthUser(scope.row)" | ||
| 200 | + v-hasPermi="['system:role:edit']" | ||
| 201 | + ></el-button> | ||
| 202 | + </el-tooltip> | ||
| 203 | + </template> | ||
| 204 | + </el-table-column> | ||
| 205 | + </el-table> | ||
| 133 | 206 | ||
| 134 | - <pagination | ||
| 135 | - v-show="total > 0" | ||
| 136 | - :total="total" | ||
| 137 | - v-model:page="queryParams.pageNum" | ||
| 138 | - v-model:limit="queryParams.pageSize" | ||
| 139 | - @pagination="getList" | ||
| 140 | - /> | 207 | + <pagination |
| 208 | + v-show="total > 0" | ||
| 209 | + :total="total" | ||
| 210 | + v-model:page="queryParams.pageNum" | ||
| 211 | + v-model:limit="queryParams.pageSize" | ||
| 212 | + @pagination="getList" | ||
| 213 | + /> | ||
| 141 | 214 | ||
| 142 | - <!-- 添加或修改角色配置对话框 --> | ||
| 143 | - <el-dialog :title="title" v-model="open" width="500px" append-to-body> | ||
| 144 | - <el-form ref="roleRef" :model="form" :rules="rules" label-width="100px"> | ||
| 145 | - <el-form-item label="角色名称" prop="roleName"> | ||
| 146 | - <el-input v-model="form.roleName" placeholder="请输入角色名称" /> | ||
| 147 | - </el-form-item> | ||
| 148 | - <el-form-item prop="roleKey"> | ||
| 149 | - <template #label> | ||
| 150 | - <span> | ||
| 151 | - <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> | ||
| 152 | - <el-icon><question-filled /></el-icon> | ||
| 153 | - </el-tooltip> | ||
| 154 | - 权限字符 | ||
| 155 | - </span> | ||
| 156 | - </template> | ||
| 157 | - <el-input v-model="form.roleKey" placeholder="请输入权限字符" /> | ||
| 158 | - </el-form-item> | ||
| 159 | - <el-form-item label="角色顺序" prop="roleSort"> | ||
| 160 | - <el-input-number v-model="form.roleSort" controls-position="right" :min="0" /> | ||
| 161 | - </el-form-item> | ||
| 162 | - <el-form-item label="状态"> | ||
| 163 | - <el-radio-group v-model="form.status"> | ||
| 164 | - <el-radio | ||
| 165 | - v-for="dict in sys_normal_disable" | ||
| 166 | - :key="dict.value" | ||
| 167 | - :label="dict.value" | ||
| 168 | - >{{ dict.label }}</el-radio> | ||
| 169 | - </el-radio-group> | ||
| 170 | - </el-form-item> | ||
| 171 | - <el-form-item label="菜单权限"> | ||
| 172 | - <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox> | ||
| 173 | - <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox> | ||
| 174 | - <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox> | ||
| 175 | - <el-tree | ||
| 176 | - class="tree-border" | ||
| 177 | - :data="menuOptions" | ||
| 178 | - show-checkbox | ||
| 179 | - ref="menuRef" | ||
| 180 | - node-key="id" | ||
| 181 | - :check-strictly="!form.menuCheckStrictly" | ||
| 182 | - empty-text="加载中,请稍候" | ||
| 183 | - :props="{ label: 'label', children: 'children' }" | ||
| 184 | - ></el-tree> | ||
| 185 | - </el-form-item> | ||
| 186 | - <el-form-item label="备注"> | ||
| 187 | - <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> | ||
| 188 | - </el-form-item> | ||
| 189 | - </el-form> | ||
| 190 | - <template #footer> | ||
| 191 | - <div class="dialog-footer"> | ||
| 192 | - <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 193 | - <el-button @click="cancel">取 消</el-button> | ||
| 194 | - </div> | ||
| 195 | - </template> | ||
| 196 | - </el-dialog> | 215 | + <!-- 添加或修改角色配置对话框 --> |
| 216 | + <el-dialog :title="title" v-model="open" width="500px" append-to-body> | ||
| 217 | + <el-form ref="roleRef" :model="form" :rules="rules" label-width="100px"> | ||
| 218 | + <el-form-item label="角色名称" prop="roleName"> | ||
| 219 | + <el-input v-model="form.roleName" placeholder="请输入角色名称" /> | ||
| 220 | + </el-form-item> | ||
| 221 | + <el-form-item prop="roleKey"> | ||
| 222 | + <template #label> | ||
| 223 | + <span> | ||
| 224 | + <el-tooltip | ||
| 225 | + content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" | ||
| 226 | + placement="top" | ||
| 227 | + > | ||
| 228 | + <el-icon><question-filled /></el-icon> | ||
| 229 | + </el-tooltip> | ||
| 230 | + 权限字符 | ||
| 231 | + </span> | ||
| 232 | + </template> | ||
| 233 | + <el-input v-model="form.roleKey" placeholder="请输入权限字符" /> | ||
| 234 | + </el-form-item> | ||
| 235 | + <el-form-item label="角色顺序" prop="roleSort"> | ||
| 236 | + <el-input-number | ||
| 237 | + v-model="form.roleSort" | ||
| 238 | + controls-position="right" | ||
| 239 | + :min="0" | ||
| 240 | + /> | ||
| 241 | + </el-form-item> | ||
| 242 | + <el-form-item label="状态"> | ||
| 243 | + <el-radio-group v-model="form.status"> | ||
| 244 | + <el-radio | ||
| 245 | + v-for="dict in sys_normal_disable" | ||
| 246 | + :key="dict.value" | ||
| 247 | + :label="dict.value" | ||
| 248 | + >{{ dict.label }}</el-radio | ||
| 249 | + > | ||
| 250 | + </el-radio-group> | ||
| 251 | + </el-form-item> | ||
| 252 | + <el-form-item label="菜单权限"> | ||
| 253 | + <el-checkbox | ||
| 254 | + v-model="menuExpand" | ||
| 255 | + @change="handleCheckedTreeExpand($event, 'menu')" | ||
| 256 | + >展开/折叠</el-checkbox | ||
| 257 | + > | ||
| 258 | + <el-checkbox | ||
| 259 | + v-model="menuNodeAll" | ||
| 260 | + @change="handleCheckedTreeNodeAll($event, 'menu')" | ||
| 261 | + >全选/全不选</el-checkbox | ||
| 262 | + > | ||
| 263 | + <el-checkbox | ||
| 264 | + v-model="form.menuCheckStrictly" | ||
| 265 | + @change="handleCheckedTreeConnect($event, 'menu')" | ||
| 266 | + >父子联动</el-checkbox | ||
| 267 | + > | ||
| 268 | + <el-tree | ||
| 269 | + class="tree-border" | ||
| 270 | + :data="menuOptions" | ||
| 271 | + show-checkbox | ||
| 272 | + ref="menuRef" | ||
| 273 | + node-key="id" | ||
| 274 | + :check-strictly="!form.menuCheckStrictly" | ||
| 275 | + empty-text="加载中,请稍候" | ||
| 276 | + :props="{ label: 'label', children: 'children' }" | ||
| 277 | + ></el-tree> | ||
| 278 | + </el-form-item> | ||
| 279 | + <el-form-item label="备注"> | ||
| 280 | + <el-input | ||
| 281 | + v-model="form.remark" | ||
| 282 | + type="textarea" | ||
| 283 | + placeholder="请输入内容" | ||
| 284 | + ></el-input> | ||
| 285 | + </el-form-item> | ||
| 286 | + </el-form> | ||
| 287 | + <template #footer> | ||
| 288 | + <div class="dialog-footer"> | ||
| 289 | + <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 290 | + <el-button @click="cancel">取 消</el-button> | ||
| 291 | + </div> | ||
| 292 | + </template> | ||
| 293 | + </el-dialog> | ||
| 197 | 294 | ||
| 198 | - <!-- 分配角色数据权限对话框 --> | ||
| 199 | - <el-dialog :title="title" v-model="openDataScope" width="500px" append-to-body> | ||
| 200 | - <el-form :model="form" label-width="80px"> | ||
| 201 | - <el-form-item label="角色名称"> | ||
| 202 | - <el-input v-model="form.roleName" :disabled="true" /> | ||
| 203 | - </el-form-item> | ||
| 204 | - <el-form-item label="权限字符"> | ||
| 205 | - <el-input v-model="form.roleKey" :disabled="true" /> | ||
| 206 | - </el-form-item> | ||
| 207 | - <el-form-item label="权限范围"> | ||
| 208 | - <el-select v-model="form.dataScope" @change="dataScopeSelectChange"> | ||
| 209 | - <el-option | ||
| 210 | - v-for="item in dataScopeOptions" | ||
| 211 | - :key="item.value" | ||
| 212 | - :label="item.label" | ||
| 213 | - :value="item.value" | ||
| 214 | - ></el-option> | ||
| 215 | - </el-select> | ||
| 216 | - </el-form-item> | ||
| 217 | - <el-form-item label="数据权限" v-show="form.dataScope == 2"> | ||
| 218 | - <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox> | ||
| 219 | - <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox> | ||
| 220 | - <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox> | ||
| 221 | - <el-tree | ||
| 222 | - class="tree-border" | ||
| 223 | - :data="deptOptions" | ||
| 224 | - show-checkbox | ||
| 225 | - default-expand-all | ||
| 226 | - ref="deptRef" | ||
| 227 | - node-key="id" | ||
| 228 | - :check-strictly="!form.deptCheckStrictly" | ||
| 229 | - empty-text="加载中,请稍候" | ||
| 230 | - :props="{ label: 'label', children: 'children' }" | ||
| 231 | - ></el-tree> | ||
| 232 | - </el-form-item> | ||
| 233 | - </el-form> | ||
| 234 | - <template #footer> | ||
| 235 | - <div class="dialog-footer"> | ||
| 236 | - <el-button type="primary" @click="submitDataScope">确 定</el-button> | ||
| 237 | - <el-button @click="cancelDataScope">取 消</el-button> | ||
| 238 | - </div> | ||
| 239 | - </template> | ||
| 240 | - </el-dialog> | ||
| 241 | - </div> | 295 | + <!-- 分配角色数据权限对话框 --> |
| 296 | + <el-dialog | ||
| 297 | + :title="title" | ||
| 298 | + v-model="openDataScope" | ||
| 299 | + width="500px" | ||
| 300 | + append-to-body | ||
| 301 | + > | ||
| 302 | + <el-form :model="form" label-width="80px"> | ||
| 303 | + <el-form-item label="角色名称"> | ||
| 304 | + <el-input v-model="form.roleName" :disabled="true" /> | ||
| 305 | + </el-form-item> | ||
| 306 | + <el-form-item label="权限字符"> | ||
| 307 | + <el-input v-model="form.roleKey" :disabled="true" /> | ||
| 308 | + </el-form-item> | ||
| 309 | + <el-form-item label="权限范围"> | ||
| 310 | + <el-select v-model="form.dataScope" @change="dataScopeSelectChange"> | ||
| 311 | + <el-option | ||
| 312 | + v-for="item in dataScopeOptions" | ||
| 313 | + :key="item.value" | ||
| 314 | + :label="item.label" | ||
| 315 | + :value="item.value" | ||
| 316 | + ></el-option> | ||
| 317 | + </el-select> | ||
| 318 | + </el-form-item> | ||
| 319 | + <el-form-item label="数据权限" v-show="form.dataScope == 2"> | ||
| 320 | + <el-checkbox | ||
| 321 | + v-model="deptExpand" | ||
| 322 | + @change="handleCheckedTreeExpand($event, 'dept')" | ||
| 323 | + >展开/折叠</el-checkbox | ||
| 324 | + > | ||
| 325 | + <el-checkbox | ||
| 326 | + v-model="deptNodeAll" | ||
| 327 | + @change="handleCheckedTreeNodeAll($event, 'dept')" | ||
| 328 | + >全选/全不选</el-checkbox | ||
| 329 | + > | ||
| 330 | + <el-checkbox | ||
| 331 | + v-model="form.deptCheckStrictly" | ||
| 332 | + @change="handleCheckedTreeConnect($event, 'dept')" | ||
| 333 | + >父子联动</el-checkbox | ||
| 334 | + > | ||
| 335 | + <el-tree | ||
| 336 | + class="tree-border" | ||
| 337 | + :data="deptOptions" | ||
| 338 | + show-checkbox | ||
| 339 | + default-expand-all | ||
| 340 | + ref="deptRef" | ||
| 341 | + node-key="id" | ||
| 342 | + :check-strictly="!form.deptCheckStrictly" | ||
| 343 | + empty-text="加载中,请稍候" | ||
| 344 | + :props="{ label: 'label', children: 'children' }" | ||
| 345 | + ></el-tree> | ||
| 346 | + </el-form-item> | ||
| 347 | + </el-form> | ||
| 348 | + <template #footer> | ||
| 349 | + <div class="dialog-footer"> | ||
| 350 | + <el-button type="primary" @click="submitDataScope">确 定</el-button> | ||
| 351 | + <el-button @click="cancelDataScope">取 消</el-button> | ||
| 352 | + </div> | ||
| 353 | + </template> | ||
| 354 | + </el-dialog> | ||
| 355 | + </div> | ||
| 242 | </template> | 356 | </template> |
| 243 | 357 | ||
| 244 | <script setup name="Role"> | 358 | <script setup name="Role"> |
| 245 | -import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole, deptTreeSelect } from "@/api/system/role"; | ||
| 246 | -import { roleMenuTreeselect, treeselect as menuTreeselect } from "@/api/system/menu"; | 359 | +import { |
| 360 | + addRole, | ||
| 361 | + changeRoleStatus, | ||
| 362 | + dataScope, | ||
| 363 | + delRole, | ||
| 364 | + getRole, | ||
| 365 | + listRole, | ||
| 366 | + updateRole, | ||
| 367 | + deptTreeSelect, | ||
| 368 | +} from "@/api/system/role"; | ||
| 369 | +import { | ||
| 370 | + roleMenuTreeselect, | ||
| 371 | + treeselect as menuTreeselect, | ||
| 372 | +} from "@/api/system/menu"; | ||
| 247 | 373 | ||
| 248 | const router = useRouter(); | 374 | const router = useRouter(); |
| 249 | const { proxy } = getCurrentInstance(); | 375 | const { proxy } = getCurrentInstance(); |
| @@ -275,7 +401,7 @@ const dataScopeOptions = ref([ | @@ -275,7 +401,7 @@ const dataScopeOptions = ref([ | ||
| 275 | { value: "2", label: "自定数据权限" }, | 401 | { value: "2", label: "自定数据权限" }, |
| 276 | { value: "3", label: "本部门数据权限" }, | 402 | { value: "3", label: "本部门数据权限" }, |
| 277 | { value: "4", label: "本部门及以下数据权限" }, | 403 | { value: "4", label: "本部门及以下数据权限" }, |
| 278 | - { value: "5", label: "仅本人数据权限" } | 404 | + { value: "5", label: "仅本人数据权限" }, |
| 279 | ]); | 405 | ]); |
| 280 | 406 | ||
| 281 | const data = reactive({ | 407 | const data = reactive({ |
| @@ -285,12 +411,16 @@ const data = reactive({ | @@ -285,12 +411,16 @@ const data = reactive({ | ||
| 285 | pageSize: 10, | 411 | pageSize: 10, |
| 286 | roleName: undefined, | 412 | roleName: undefined, |
| 287 | roleKey: undefined, | 413 | roleKey: undefined, |
| 288 | - status: undefined | 414 | + status: undefined, |
| 289 | }, | 415 | }, |
| 290 | rules: { | 416 | rules: { |
| 291 | - roleName: [{ required: true, message: "角色名称不能为空", trigger: "blur" }], | 417 | + roleName: [ |
| 418 | + { required: true, message: "角色名称不能为空", trigger: "blur" }, | ||
| 419 | + ], | ||
| 292 | roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }], | 420 | roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }], |
| 293 | - roleSort: [{ required: true, message: "角色顺序不能为空", trigger: "blur" }] | 421 | + roleSort: [ |
| 422 | + { required: true, message: "角色顺序不能为空", trigger: "blur" }, | ||
| 423 | + ], | ||
| 294 | }, | 424 | }, |
| 295 | }); | 425 | }); |
| 296 | 426 | ||
| @@ -299,11 +429,13 @@ const { queryParams, form, rules } = toRefs(data); | @@ -299,11 +429,13 @@ const { queryParams, form, rules } = toRefs(data); | ||
| 299 | /** 查询角色列表 */ | 429 | /** 查询角色列表 */ |
| 300 | function getList() { | 430 | function getList() { |
| 301 | loading.value = true; | 431 | loading.value = true; |
| 302 | - listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { | ||
| 303 | - roleList.value = response.rows; | ||
| 304 | - total.value = response.total; | ||
| 305 | - loading.value = false; | ||
| 306 | - }); | 432 | + listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 433 | + (response) => { | ||
| 434 | + roleList.value = response.rows; | ||
| 435 | + total.value = response.total; | ||
| 436 | + loading.value = false; | ||
| 437 | + } | ||
| 438 | + ); | ||
| 307 | } | 439 | } |
| 308 | /** 搜索按钮操作 */ | 440 | /** 搜索按钮操作 */ |
| 309 | function handleQuery() { | 441 | function handleQuery() { |
| @@ -319,35 +451,47 @@ function resetQuery() { | @@ -319,35 +451,47 @@ function resetQuery() { | ||
| 319 | /** 删除按钮操作 */ | 451 | /** 删除按钮操作 */ |
| 320 | function handleDelete(row) { | 452 | function handleDelete(row) { |
| 321 | const roleIds = row.roleId || ids.value; | 453 | const roleIds = row.roleId || ids.value; |
| 322 | - proxy.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function () { | ||
| 323 | - return delRole(roleIds); | ||
| 324 | - }).then(() => { | ||
| 325 | - getList(); | ||
| 326 | - proxy.$modal.msgSuccess("删除成功"); | ||
| 327 | - }).catch(() => {}); | 454 | + proxy.$modal |
| 455 | + .confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?') | ||
| 456 | + .then(function () { | ||
| 457 | + return delRole(roleIds); | ||
| 458 | + }) | ||
| 459 | + .then(() => { | ||
| 460 | + getList(); | ||
| 461 | + proxy.$modal.msgSuccess("删除成功"); | ||
| 462 | + }) | ||
| 463 | + .catch(() => {}); | ||
| 328 | } | 464 | } |
| 329 | /** 导出按钮操作 */ | 465 | /** 导出按钮操作 */ |
| 330 | function handleExport() { | 466 | function handleExport() { |
| 331 | - proxy.download("system/role/export", { | ||
| 332 | - ...queryParams.value, | ||
| 333 | - }, `role_${new Date().getTime()}.xlsx`); | 467 | + proxy.download( |
| 468 | + "system/role/export", | ||
| 469 | + { | ||
| 470 | + ...queryParams.value, | ||
| 471 | + }, | ||
| 472 | + `role_${new Date().getTime()}.xlsx` | ||
| 473 | + ); | ||
| 334 | } | 474 | } |
| 335 | /** 多选框选中数据 */ | 475 | /** 多选框选中数据 */ |
| 336 | function handleSelectionChange(selection) { | 476 | function handleSelectionChange(selection) { |
| 337 | - ids.value = selection.map(item => item.roleId); | 477 | + ids.value = selection.map((item) => item.roleId); |
| 338 | single.value = selection.length != 1; | 478 | single.value = selection.length != 1; |
| 339 | multiple.value = !selection.length; | 479 | multiple.value = !selection.length; |
| 340 | } | 480 | } |
| 341 | /** 角色状态修改 */ | 481 | /** 角色状态修改 */ |
| 342 | function handleStatusChange(row) { | 482 | function handleStatusChange(row) { |
| 343 | let text = row.status === "0" ? "启用" : "停用"; | 483 | let text = row.status === "0" ? "启用" : "停用"; |
| 344 | - proxy.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function () { | ||
| 345 | - return changeRoleStatus(row.roleId, row.status); | ||
| 346 | - }).then(() => { | ||
| 347 | - proxy.$modal.msgSuccess(text + "成功"); | ||
| 348 | - }).catch(function () { | ||
| 349 | - row.status = row.status === "0" ? "1" : "0"; | ||
| 350 | - }); | 484 | + proxy.$modal |
| 485 | + .confirm('确认要"' + text + '""' + row.roleName + '"角色吗?') | ||
| 486 | + .then(function () { | ||
| 487 | + return changeRoleStatus(row.roleId, row.status); | ||
| 488 | + }) | ||
| 489 | + .then(() => { | ||
| 490 | + proxy.$modal.msgSuccess(text + "成功"); | ||
| 491 | + }) | ||
| 492 | + .catch(function () { | ||
| 493 | + row.status = row.status === "0" ? "1" : "0"; | ||
| 494 | + }); | ||
| 351 | } | 495 | } |
| 352 | /** 更多操作 */ | 496 | /** 更多操作 */ |
| 353 | function handleCommand(command, row) { | 497 | function handleCommand(command, row) { |
| @@ -368,7 +512,7 @@ function handleAuthUser(row) { | @@ -368,7 +512,7 @@ function handleAuthUser(row) { | ||
| 368 | } | 512 | } |
| 369 | /** 查询菜单树结构 */ | 513 | /** 查询菜单树结构 */ |
| 370 | function getMenuTreeselect() { | 514 | function getMenuTreeselect() { |
| 371 | - menuTreeselect().then(response => { | 515 | + menuTreeselect().then((response) => { |
| 372 | menuOptions.value = response.data; | 516 | menuOptions.value = response.data; |
| 373 | }); | 517 | }); |
| 374 | } | 518 | } |
| @@ -400,7 +544,7 @@ function reset() { | @@ -400,7 +544,7 @@ function reset() { | ||
| 400 | deptIds: [], | 544 | deptIds: [], |
| 401 | menuCheckStrictly: true, | 545 | menuCheckStrictly: true, |
| 402 | deptCheckStrictly: true, | 546 | deptCheckStrictly: true, |
| 403 | - remark: undefined | 547 | + remark: undefined, |
| 404 | }; | 548 | }; |
| 405 | proxy.resetForm("roleRef"); | 549 | proxy.resetForm("roleRef"); |
| 406 | } | 550 | } |
| @@ -416,7 +560,7 @@ function handleUpdate(row) { | @@ -416,7 +560,7 @@ function handleUpdate(row) { | ||
| 416 | reset(); | 560 | reset(); |
| 417 | const roleId = row.roleId || ids.value; | 561 | const roleId = row.roleId || ids.value; |
| 418 | const roleMenu = getRoleMenuTreeselect(roleId); | 562 | const roleMenu = getRoleMenuTreeselect(roleId); |
| 419 | - getRole(roleId).then(response => { | 563 | + getRole(roleId).then((response) => { |
| 420 | form.value = response.data; | 564 | form.value = response.data; |
| 421 | form.value.roleSort = Number(form.value.roleSort); | 565 | form.value.roleSort = Number(form.value.roleSort); |
| 422 | open.value = true; | 566 | open.value = true; |
| @@ -435,14 +579,14 @@ function handleUpdate(row) { | @@ -435,14 +579,14 @@ function handleUpdate(row) { | ||
| 435 | } | 579 | } |
| 436 | /** 根据角色ID查询菜单树结构 */ | 580 | /** 根据角色ID查询菜单树结构 */ |
| 437 | function getRoleMenuTreeselect(roleId) { | 581 | function getRoleMenuTreeselect(roleId) { |
| 438 | - return roleMenuTreeselect(roleId).then(response => { | 582 | + return roleMenuTreeselect(roleId).then((response) => { |
| 439 | menuOptions.value = response.menus; | 583 | menuOptions.value = response.menus; |
| 440 | return response; | 584 | return response; |
| 441 | }); | 585 | }); |
| 442 | } | 586 | } |
| 443 | /** 根据角色ID查询部门树结构 */ | 587 | /** 根据角色ID查询部门树结构 */ |
| 444 | function getDeptTree(roleId) { | 588 | function getDeptTree(roleId) { |
| 445 | - return deptTreeSelect(roleId).then(response => { | 589 | + return deptTreeSelect(roleId).then((response) => { |
| 446 | deptOptions.value = response.depts; | 590 | deptOptions.value = response.depts; |
| 447 | return response; | 591 | return response; |
| 448 | }); | 592 | }); |
| @@ -488,18 +632,18 @@ function getMenuAllCheckedKeys() { | @@ -488,18 +632,18 @@ function getMenuAllCheckedKeys() { | ||
| 488 | } | 632 | } |
| 489 | /** 提交按钮 */ | 633 | /** 提交按钮 */ |
| 490 | function submitForm() { | 634 | function submitForm() { |
| 491 | - proxy.$refs["roleRef"].validate(valid => { | 635 | + proxy.$refs["roleRef"].validate((valid) => { |
| 492 | if (valid) { | 636 | if (valid) { |
| 493 | if (form.value.roleId != undefined) { | 637 | if (form.value.roleId != undefined) { |
| 494 | form.value.menuIds = getMenuAllCheckedKeys(); | 638 | form.value.menuIds = getMenuAllCheckedKeys(); |
| 495 | - updateRole(form.value).then(response => { | 639 | + updateRole(form.value).then((response) => { |
| 496 | proxy.$modal.msgSuccess("修改成功"); | 640 | proxy.$modal.msgSuccess("修改成功"); |
| 497 | open.value = false; | 641 | open.value = false; |
| 498 | getList(); | 642 | getList(); |
| 499 | }); | 643 | }); |
| 500 | } else { | 644 | } else { |
| 501 | form.value.menuIds = getMenuAllCheckedKeys(); | 645 | form.value.menuIds = getMenuAllCheckedKeys(); |
| 502 | - addRole(form.value).then(response => { | 646 | + addRole(form.value).then((response) => { |
| 503 | proxy.$modal.msgSuccess("新增成功"); | 647 | proxy.$modal.msgSuccess("新增成功"); |
| 504 | open.value = false; | 648 | open.value = false; |
| 505 | getList(); | 649 | getList(); |
| @@ -523,11 +667,11 @@ function dataScopeSelectChange(value) { | @@ -523,11 +667,11 @@ function dataScopeSelectChange(value) { | ||
| 523 | function handleDataScope(row) { | 667 | function handleDataScope(row) { |
| 524 | reset(); | 668 | reset(); |
| 525 | const deptTreeSelect = getDeptTree(row.roleId); | 669 | const deptTreeSelect = getDeptTree(row.roleId); |
| 526 | - getRole(row.roleId).then(response => { | 670 | + getRole(row.roleId).then((response) => { |
| 527 | form.value = response.data; | 671 | form.value = response.data; |
| 528 | openDataScope.value = true; | 672 | openDataScope.value = true; |
| 529 | nextTick(() => { | 673 | nextTick(() => { |
| 530 | - deptTreeSelect.then(res => { | 674 | + deptTreeSelect.then((res) => { |
| 531 | nextTick(() => { | 675 | nextTick(() => { |
| 532 | if (deptRef.value) { | 676 | if (deptRef.value) { |
| 533 | deptRef.value.setCheckedKeys(res.checkedKeys); | 677 | deptRef.value.setCheckedKeys(res.checkedKeys); |
| @@ -542,7 +686,7 @@ function handleDataScope(row) { | @@ -542,7 +686,7 @@ function handleDataScope(row) { | ||
| 542 | function submitDataScope() { | 686 | function submitDataScope() { |
| 543 | if (form.value.roleId != undefined) { | 687 | if (form.value.roleId != undefined) { |
| 544 | form.value.deptIds = getDeptAllCheckedKeys(); | 688 | form.value.deptIds = getDeptAllCheckedKeys(); |
| 545 | - dataScope(form.value).then(response => { | 689 | + dataScope(form.value).then((response) => { |
| 546 | proxy.$modal.msgSuccess("修改成功"); | 690 | proxy.$modal.msgSuccess("修改成功"); |
| 547 | openDataScope.value = false; | 691 | openDataScope.value = false; |
| 548 | getList(); | 692 | getList(); |
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | ref="queryRef" | 33 | ref="queryRef" |
| 34 | :inline="true" | 34 | :inline="true" |
| 35 | v-show="showSearch" | 35 | v-show="showSearch" |
| 36 | - label-width="68px" | 36 | + label-width="80px" |
| 37 | > | 37 | > |
| 38 | <el-form-item label="用户名称" prop="userName"> | 38 | <el-form-item label="用户名称" prop="userName"> |
| 39 | <el-input | 39 | <el-input |
-
请 注册 或 登录 后发表评论