正在显示
20 个修改的文件
包含
475 行增加
和
153 行删除
| @@ -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"> | 2 | <div class="app-container"> |
| 3 | - <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> | 3 | + <el-form |
| 4 | + :model="queryParams" | ||
| 5 | + ref="queryRef" | ||
| 6 | + :inline="true" | ||
| 7 | + v-show="showSearch" | ||
| 8 | + label-width="80px" | ||
| 9 | + > | ||
| 4 | <el-form-item label="参数名称" prop="configName"> | 10 | <el-form-item label="参数名称" prop="configName"> |
| 5 | <el-input | 11 | <el-input |
| 6 | v-model="queryParams.configName" | 12 | v-model="queryParams.configName" |
| @@ -20,7 +26,11 @@ | @@ -20,7 +26,11 @@ | ||
| 20 | /> | 26 | /> |
| 21 | </el-form-item> | 27 | </el-form-item> |
| 22 | <el-form-item label="系统内置" prop="configType"> | 28 | <el-form-item label="系统内置" prop="configType"> |
| 23 | - <el-select v-model="queryParams.configType" placeholder="系统内置" clearable> | 29 | + <el-select |
| 30 | + v-model="queryParams.configType" | ||
| 31 | + placeholder="系统内置" | ||
| 32 | + clearable | ||
| 33 | + > | ||
| 24 | <el-option | 34 | <el-option |
| 25 | v-for="dict in sys_yes_no" | 35 | v-for="dict in sys_yes_no" |
| 26 | :key="dict.value" | 36 | :key="dict.value" |
| @@ -29,7 +39,7 @@ | @@ -29,7 +39,7 @@ | ||
| 29 | /> | 39 | /> |
| 30 | </el-select> | 40 | </el-select> |
| 31 | </el-form-item> | 41 | </el-form-item> |
| 32 | - <el-form-item label="创建时间" style="width: 308px;"> | 42 | + <el-form-item label="创建时间" style="width: 308px"> |
| 33 | <el-date-picker | 43 | <el-date-picker |
| 34 | v-model="dateRange" | 44 | v-model="dateRange" |
| 35 | value-format="YYYY-MM-DD" | 45 | value-format="YYYY-MM-DD" |
| @@ -40,7 +50,9 @@ | @@ -40,7 +50,9 @@ | ||
| 40 | ></el-date-picker> | 50 | ></el-date-picker> |
| 41 | </el-form-item> | 51 | </el-form-item> |
| 42 | <el-form-item> | 52 | <el-form-item> |
| 43 | - <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | 53 | + <el-button type="primary" icon="Search" @click="handleQuery" |
| 54 | + >搜索</el-button | ||
| 55 | + > | ||
| 44 | <el-button icon="Refresh" @click="resetQuery">重置</el-button> | 56 | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| 45 | </el-form-item> | 57 | </el-form-item> |
| 46 | </el-form> | 58 | </el-form> |
| @@ -53,7 +65,8 @@ | @@ -53,7 +65,8 @@ | ||
| 53 | icon="Plus" | 65 | icon="Plus" |
| 54 | @click="handleAdd" | 66 | @click="handleAdd" |
| 55 | v-hasPermi="['system:config:add']" | 67 | v-hasPermi="['system:config:add']" |
| 56 | - >新增</el-button> | 68 | + >新增</el-button |
| 69 | + > | ||
| 57 | </el-col> | 70 | </el-col> |
| 58 | <el-col :span="1.5"> | 71 | <el-col :span="1.5"> |
| 59 | <el-button | 72 | <el-button |
| @@ -63,7 +76,8 @@ | @@ -63,7 +76,8 @@ | ||
| 63 | :disabled="single" | 76 | :disabled="single" |
| 64 | @click="handleUpdate" | 77 | @click="handleUpdate" |
| 65 | v-hasPermi="['system:config:edit']" | 78 | v-hasPermi="['system:config:edit']" |
| 66 | - >修改</el-button> | 79 | + >修改</el-button |
| 80 | + > | ||
| 67 | </el-col> | 81 | </el-col> |
| 68 | <el-col :span="1.5"> | 82 | <el-col :span="1.5"> |
| 69 | <el-button | 83 | <el-button |
| @@ -73,7 +87,8 @@ | @@ -73,7 +87,8 @@ | ||
| 73 | :disabled="multiple" | 87 | :disabled="multiple" |
| 74 | @click="handleDelete" | 88 | @click="handleDelete" |
| 75 | v-hasPermi="['system:config:remove']" | 89 | v-hasPermi="['system:config:remove']" |
| 76 | - >删除</el-button> | 90 | + >删除</el-button |
| 91 | + > | ||
| 77 | </el-col> | 92 | </el-col> |
| 78 | <el-col :span="1.5"> | 93 | <el-col :span="1.5"> |
| 79 | <el-button | 94 | <el-button |
| @@ -82,7 +97,8 @@ | @@ -82,7 +97,8 @@ | ||
| 82 | icon="Download" | 97 | icon="Download" |
| 83 | @click="handleExport" | 98 | @click="handleExport" |
| 84 | v-hasPermi="['system:config:export']" | 99 | v-hasPermi="['system:config:export']" |
| 85 | - >导出</el-button> | 100 | + >导出</el-button |
| 101 | + > | ||
| 86 | </el-col> | 102 | </el-col> |
| 87 | <el-col :span="1.5"> | 103 | <el-col :span="1.5"> |
| 88 | <el-button | 104 | <el-button |
| @@ -91,32 +107,79 @@ | @@ -91,32 +107,79 @@ | ||
| 91 | icon="Refresh" | 107 | icon="Refresh" |
| 92 | @click="handleRefreshCache" | 108 | @click="handleRefreshCache" |
| 93 | v-hasPermi="['system:config:remove']" | 109 | v-hasPermi="['system:config:remove']" |
| 94 | - >刷新缓存</el-button> | 110 | + >刷新缓存</el-button |
| 111 | + > | ||
| 95 | </el-col> | 112 | </el-col> |
| 96 | - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | 113 | + <right-toolbar |
| 114 | + v-model:showSearch="showSearch" | ||
| 115 | + @queryTable="getList" | ||
| 116 | + ></right-toolbar> | ||
| 97 | </el-row> | 117 | </el-row> |
| 98 | 118 | ||
| 99 | - <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"> | 119 | + <el-table |
| 120 | + v-loading="loading" | ||
| 121 | + :data="configList" | ||
| 122 | + @selection-change="handleSelectionChange" | ||
| 123 | + > | ||
| 100 | <el-table-column type="selection" width="55" align="center" /> | 124 | <el-table-column type="selection" width="55" align="center" /> |
| 101 | <el-table-column label="参数主键" align="center" prop="configId" /> | 125 | <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" /> | 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" | ||
| 137 | + /> | ||
| 104 | <el-table-column label="参数键值" align="center" prop="configValue" /> | 138 | <el-table-column label="参数键值" align="center" prop="configValue" /> |
| 105 | <el-table-column label="系统内置" align="center" prop="configType"> | 139 | <el-table-column label="系统内置" align="center" prop="configType"> |
| 106 | <template #default="scope"> | 140 | <template #default="scope"> |
| 107 | <dict-tag :options="sys_yes_no" :value="scope.row.configType" /> | 141 | <dict-tag :options="sys_yes_no" :value="scope.row.configType" /> |
| 108 | </template> | 142 | </template> |
| 109 | </el-table-column> | 143 | </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"> | 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 | + > | ||
| 112 | <template #default="scope"> | 156 | <template #default="scope"> |
| 113 | <span>{{ parseTime(scope.row.createTime) }}</span> | 157 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 114 | </template> | 158 | </template> |
| 115 | </el-table-column> | 159 | </el-table-column> |
| 116 | - <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width"> | 160 | + <el-table-column |
| 161 | + label="操作" | ||
| 162 | + align="center" | ||
| 163 | + width="150" | ||
| 164 | + class-name="small-padding fixed-width" | ||
| 165 | + > | ||
| 117 | <template #default="scope"> | 166 | <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> | 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 | + > | ||
| 120 | </template> | 183 | </template> |
| 121 | </el-table-column> | 184 | </el-table-column> |
| 122 | </el-table> | 185 | </el-table> |
| @@ -147,11 +210,16 @@ | @@ -147,11 +210,16 @@ | ||
| 147 | v-for="dict in sys_yes_no" | 210 | v-for="dict in sys_yes_no" |
| 148 | :key="dict.value" | 211 | :key="dict.value" |
| 149 | :label="dict.value" | 212 | :label="dict.value" |
| 150 | - >{{ dict.label }}</el-radio> | 213 | + >{{ dict.label }}</el-radio |
| 214 | + > | ||
| 151 | </el-radio-group> | 215 | </el-radio-group> |
| 152 | </el-form-item> | 216 | </el-form-item> |
| 153 | <el-form-item label="备注" prop="remark"> | 217 | <el-form-item label="备注" prop="remark"> |
| 154 | - <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | 218 | + <el-input |
| 219 | + v-model="form.remark" | ||
| 220 | + type="textarea" | ||
| 221 | + placeholder="请输入内容" | ||
| 222 | + /> | ||
| 155 | </el-form-item> | 223 | </el-form-item> |
| 156 | </el-form> | 224 | </el-form> |
| 157 | <template #footer> | 225 | <template #footer> |
| @@ -165,7 +233,14 @@ | @@ -165,7 +233,14 @@ | ||
| 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 => { | 286 | + listConfig(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 287 | + (response) => { | ||
| 206 | configList.value = response.rows; | 288 | configList.value = response.rows; |
| 207 | total.value = response.total; | 289 | total.value = response.total; |
| 208 | loading.value = false; | 290 | loading.value = false; |
| 209 | - }); | 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 () { | 367 | + proxy.$modal |
| 368 | + .confirm('是否确认删除参数编号为"' + configIds + '"的数据项?') | ||
| 369 | + .then(function () { | ||
| 285 | return delConfig(configIds); | 370 | return delConfig(configIds); |
| 286 | - }).then(() => { | 371 | + }) |
| 372 | + .then(() => { | ||
| 287 | getList(); | 373 | getList(); |
| 288 | proxy.$modal.msgSuccess("删除成功"); | 374 | proxy.$modal.msgSuccess("删除成功"); |
| 289 | - }).catch(() => {}); | 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"> | 2 | <div class="app-container"> |
| 3 | - <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> | 3 | + <el-form |
| 4 | + :model="queryParams" | ||
| 5 | + ref="queryRef" | ||
| 6 | + :inline="true" | ||
| 7 | + v-show="showSearch" | ||
| 8 | + label-width="80px" | ||
| 9 | + > | ||
| 4 | <el-form-item label="字典名称" prop="dictName"> | 10 | <el-form-item label="字典名称" prop="dictName"> |
| 5 | <el-input | 11 | <el-input |
| 6 | v-model="queryParams.dictName" | 12 | v-model="queryParams.dictName" |
| @@ -45,7 +51,9 @@ | @@ -45,7 +51,9 @@ | ||
| 45 | ></el-date-picker> | 51 | ></el-date-picker> |
| 46 | </el-form-item> | 52 | </el-form-item> |
| 47 | <el-form-item> | 53 | <el-form-item> |
| 48 | - <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | 54 | + <el-button type="primary" icon="Search" @click="handleQuery" |
| 55 | + >搜索</el-button | ||
| 56 | + > | ||
| 49 | <el-button icon="Refresh" @click="resetQuery">重置</el-button> | 57 | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| 50 | </el-form-item> | 58 | </el-form-item> |
| 51 | </el-form> | 59 | </el-form> |
| @@ -58,7 +66,8 @@ | @@ -58,7 +66,8 @@ | ||
| 58 | icon="Plus" | 66 | icon="Plus" |
| 59 | @click="handleAdd" | 67 | @click="handleAdd" |
| 60 | v-hasPermi="['system:dict:add']" | 68 | v-hasPermi="['system:dict:add']" |
| 61 | - >新增</el-button> | 69 | + >新增</el-button |
| 70 | + > | ||
| 62 | </el-col> | 71 | </el-col> |
| 63 | <el-col :span="1.5"> | 72 | <el-col :span="1.5"> |
| 64 | <el-button | 73 | <el-button |
| @@ -68,7 +77,8 @@ | @@ -68,7 +77,8 @@ | ||
| 68 | :disabled="single" | 77 | :disabled="single" |
| 69 | @click="handleUpdate" | 78 | @click="handleUpdate" |
| 70 | v-hasPermi="['system:dict:edit']" | 79 | v-hasPermi="['system:dict:edit']" |
| 71 | - >修改</el-button> | 80 | + >修改</el-button |
| 81 | + > | ||
| 72 | </el-col> | 82 | </el-col> |
| 73 | <el-col :span="1.5"> | 83 | <el-col :span="1.5"> |
| 74 | <el-button | 84 | <el-button |
| @@ -78,7 +88,8 @@ | @@ -78,7 +88,8 @@ | ||
| 78 | :disabled="multiple" | 88 | :disabled="multiple" |
| 79 | @click="handleDelete" | 89 | @click="handleDelete" |
| 80 | v-hasPermi="['system:dict:remove']" | 90 | v-hasPermi="['system:dict:remove']" |
| 81 | - >删除</el-button> | 91 | + >删除</el-button |
| 92 | + > | ||
| 82 | </el-col> | 93 | </el-col> |
| 83 | <el-col :span="1.5"> | 94 | <el-col :span="1.5"> |
| 84 | <el-button | 95 | <el-button |
| @@ -87,7 +98,8 @@ | @@ -87,7 +98,8 @@ | ||
| 87 | icon="Download" | 98 | icon="Download" |
| 88 | @click="handleExport" | 99 | @click="handleExport" |
| 89 | v-hasPermi="['system:dict:export']" | 100 | v-hasPermi="['system:dict:export']" |
| 90 | - >导出</el-button> | 101 | + >导出</el-button |
| 102 | + > | ||
| 91 | </el-col> | 103 | </el-col> |
| 92 | <el-col :span="1.5"> | 104 | <el-col :span="1.5"> |
| 93 | <el-button | 105 | <el-button |
| @@ -96,18 +108,38 @@ | @@ -96,18 +108,38 @@ | ||
| 96 | icon="Refresh" | 108 | icon="Refresh" |
| 97 | @click="handleRefreshCache" | 109 | @click="handleRefreshCache" |
| 98 | v-hasPermi="['system:dict:remove']" | 110 | v-hasPermi="['system:dict:remove']" |
| 99 | - >刷新缓存</el-button> | 111 | + >刷新缓存</el-button |
| 112 | + > | ||
| 100 | </el-col> | 113 | </el-col> |
| 101 | - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | 114 | + <right-toolbar |
| 115 | + v-model:showSearch="showSearch" | ||
| 116 | + @queryTable="getList" | ||
| 117 | + ></right-toolbar> | ||
| 102 | </el-row> | 118 | </el-row> |
| 103 | 119 | ||
| 104 | - <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> | 120 | + <el-table |
| 121 | + v-loading="loading" | ||
| 122 | + :data="typeList" | ||
| 123 | + @selection-change="handleSelectionChange" | ||
| 124 | + > | ||
| 105 | <el-table-column type="selection" width="55" align="center" /> | 125 | <el-table-column type="selection" width="55" align="center" /> |
| 106 | <el-table-column label="字典编号" align="center" prop="dictId" /> | 126 | <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"> | 127 | + <el-table-column |
| 128 | + label="字典名称" | ||
| 129 | + align="center" | ||
| 130 | + prop="dictName" | ||
| 131 | + :show-overflow-tooltip="true" | ||
| 132 | + /> | ||
| 133 | + <el-table-column | ||
| 134 | + label="字典类型" | ||
| 135 | + align="center" | ||
| 136 | + :show-overflow-tooltip="true" | ||
| 137 | + > | ||
| 109 | <template #default="scope"> | 138 | <template #default="scope"> |
| 110 | - <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> | 139 | + <router-link |
| 140 | + :to="'/system/dict-data/index/' + scope.row.dictId" | ||
| 141 | + class="link-type" | ||
| 142 | + > | ||
| 111 | <span>{{ scope.row.dictType }}</span> | 143 | <span>{{ scope.row.dictType }}</span> |
| 112 | </router-link> | 144 | </router-link> |
| 113 | </template> | 145 | </template> |
| @@ -117,16 +149,45 @@ | @@ -117,16 +149,45 @@ | ||
| 117 | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> | 149 | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| 118 | </template> | 150 | </template> |
| 119 | </el-table-column> | 151 | </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"> | 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 | + > | ||
| 122 | <template #default="scope"> | 164 | <template #default="scope"> |
| 123 | <span>{{ parseTime(scope.row.createTime) }}</span> | 165 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 124 | </template> | 166 | </template> |
| 125 | </el-table-column> | 167 | </el-table-column> |
| 126 | - <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> | 168 | + <el-table-column |
| 169 | + label="操作" | ||
| 170 | + align="center" | ||
| 171 | + width="160" | ||
| 172 | + class-name="small-padding fixed-width" | ||
| 173 | + > | ||
| 127 | <template #default="scope"> | 174 | <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> | 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 | + > | ||
| 130 | </template> | 191 | </template> |
| 131 | </el-table-column> | 192 | </el-table-column> |
| 132 | </el-table> | 193 | </el-table> |
| @@ -154,11 +215,16 @@ | @@ -154,11 +215,16 @@ | ||
| 154 | v-for="dict in sys_normal_disable" | 215 | v-for="dict in sys_normal_disable" |
| 155 | :key="dict.value" | 216 | :key="dict.value" |
| 156 | :label="dict.value" | 217 | :label="dict.value" |
| 157 | - >{{ dict.label }}</el-radio> | 218 | + >{{ dict.label }}</el-radio |
| 219 | + > | ||
| 158 | </el-radio-group> | 220 | </el-radio-group> |
| 159 | </el-form-item> | 221 | </el-form-item> |
| 160 | <el-form-item label="备注" prop="remark"> | 222 | <el-form-item label="备注" prop="remark"> |
| 161 | - <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> | 223 | + <el-input |
| 224 | + v-model="form.remark" | ||
| 225 | + type="textarea" | ||
| 226 | + placeholder="请输入内容" | ||
| 227 | + ></el-input> | ||
| 162 | </el-form-item> | 228 | </el-form-item> |
| 163 | </el-form> | 229 | </el-form> |
| 164 | <template #footer> | 230 | <template #footer> |
| @@ -172,8 +238,15 @@ | @@ -172,8 +238,15 @@ | ||
| 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 => { | 289 | + listType(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 290 | + (response) => { | ||
| 213 | typeList.value = response.rows; | 291 | typeList.value = response.rows; |
| 214 | total.value = response.total; | 292 | total.value = response.total; |
| 215 | loading.value = false; | 293 | loading.value = false; |
| 216 | - }); | 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() { | 369 | + proxy.$modal |
| 370 | + .confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?') | ||
| 371 | + .then(function () { | ||
| 291 | return delType(dictIds); | 372 | return delType(dictIds); |
| 292 | - }).then(() => { | 373 | + }) |
| 374 | + .then(() => { | ||
| 293 | getList(); | 375 | getList(); |
| 294 | proxy.$modal.msgSuccess("删除成功"); | 376 | proxy.$modal.msgSuccess("删除成功"); |
| 295 | - }).catch(() => {}); | 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"> | 2 | <div class="app-container"> |
| 3 | - <el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px"> | 3 | + <el-form |
| 4 | + :model="queryParams" | ||
| 5 | + ref="queryRef" | ||
| 6 | + v-show="showSearch" | ||
| 7 | + :inline="true" | ||
| 8 | + label-width="80px" | ||
| 9 | + > | ||
| 4 | <el-form-item label="角色名称" prop="roleName"> | 10 | <el-form-item label="角色名称" prop="roleName"> |
| 5 | <el-input | 11 | <el-input |
| 6 | v-model="queryParams.roleName" | 12 | v-model="queryParams.roleName" |
| @@ -45,7 +51,9 @@ | @@ -45,7 +51,9 @@ | ||
| 45 | ></el-date-picker> | 51 | ></el-date-picker> |
| 46 | </el-form-item> | 52 | </el-form-item> |
| 47 | <el-form-item> | 53 | <el-form-item> |
| 48 | - <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | 54 | + <el-button type="primary" icon="Search" @click="handleQuery" |
| 55 | + >搜索</el-button | ||
| 56 | + > | ||
| 49 | <el-button icon="Refresh" @click="resetQuery">重置</el-button> | 57 | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| 50 | </el-form-item> | 58 | </el-form-item> |
| 51 | </el-form> | 59 | </el-form> |
| @@ -57,7 +65,8 @@ | @@ -57,7 +65,8 @@ | ||
| 57 | icon="Plus" | 65 | icon="Plus" |
| 58 | @click="handleAdd" | 66 | @click="handleAdd" |
| 59 | v-hasPermi="['system:role:add']" | 67 | v-hasPermi="['system:role:add']" |
| 60 | - >新增</el-button> | 68 | + >新增</el-button |
| 69 | + > | ||
| 61 | </el-col> | 70 | </el-col> |
| 62 | <el-col :span="1.5"> | 71 | <el-col :span="1.5"> |
| 63 | <el-button | 72 | <el-button |
| @@ -67,7 +76,8 @@ | @@ -67,7 +76,8 @@ | ||
| 67 | :disabled="single" | 76 | :disabled="single" |
| 68 | @click="handleUpdate" | 77 | @click="handleUpdate" |
| 69 | v-hasPermi="['system:role:edit']" | 78 | v-hasPermi="['system:role:edit']" |
| 70 | - >修改</el-button> | 79 | + >修改</el-button |
| 80 | + > | ||
| 71 | </el-col> | 81 | </el-col> |
| 72 | <el-col :span="1.5"> | 82 | <el-col :span="1.5"> |
| 73 | <el-button | 83 | <el-button |
| @@ -77,7 +87,8 @@ | @@ -77,7 +87,8 @@ | ||
| 77 | :disabled="multiple" | 87 | :disabled="multiple" |
| 78 | @click="handleDelete" | 88 | @click="handleDelete" |
| 79 | v-hasPermi="['system:role:remove']" | 89 | v-hasPermi="['system:role:remove']" |
| 80 | - >删除</el-button> | 90 | + >删除</el-button |
| 91 | + > | ||
| 81 | </el-col> | 92 | </el-col> |
| 82 | <el-col :span="1.5"> | 93 | <el-col :span="1.5"> |
| 83 | <el-button | 94 | <el-button |
| @@ -86,17 +97,35 @@ | @@ -86,17 +97,35 @@ | ||
| 86 | icon="Download" | 97 | icon="Download" |
| 87 | @click="handleExport" | 98 | @click="handleExport" |
| 88 | v-hasPermi="['system:role:export']" | 99 | v-hasPermi="['system:role:export']" |
| 89 | - >导出</el-button> | 100 | + >导出</el-button |
| 101 | + > | ||
| 90 | </el-col> | 102 | </el-col> |
| 91 | - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | 103 | + <right-toolbar |
| 104 | + v-model:showSearch="showSearch" | ||
| 105 | + @queryTable="getList" | ||
| 106 | + ></right-toolbar> | ||
| 92 | </el-row> | 107 | </el-row> |
| 93 | 108 | ||
| 94 | <!-- 表格数据 --> | 109 | <!-- 表格数据 --> |
| 95 | - <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"> | 110 | + <el-table |
| 111 | + v-loading="loading" | ||
| 112 | + :data="roleList" | ||
| 113 | + @selection-change="handleSelectionChange" | ||
| 114 | + > | ||
| 96 | <el-table-column type="selection" width="55" align="center" /> | 115 | <el-table-column type="selection" width="55" align="center" /> |
| 97 | <el-table-column label="角色编号" prop="roleId" width="120" /> | 116 | <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" /> | 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 | + /> | ||
| 100 | <el-table-column label="显示顺序" prop="roleSort" width="100" /> | 129 | <el-table-column label="显示顺序" prop="roleSort" width="100" /> |
| 101 | <el-table-column label="状态" align="center" width="100"> | 130 | <el-table-column label="状态" align="center" width="100"> |
| 102 | <template #default="scope"> | 131 | <template #default="scope"> |
| @@ -113,19 +142,63 @@ | @@ -113,19 +142,63 @@ | ||
| 113 | <span>{{ parseTime(scope.row.createTime) }}</span> | 142 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 114 | </template> | 143 | </template> |
| 115 | </el-table-column> | 144 | </el-table-column> |
| 116 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | 145 | + <el-table-column |
| 146 | + label="操作" | ||
| 147 | + align="center" | ||
| 148 | + class-name="small-padding fixed-width" | ||
| 149 | + > | ||
| 117 | <template #default="scope"> | 150 | <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> | 151 | + <el-tooltip |
| 152 | + content="修改" | ||
| 153 | + placement="top" | ||
| 154 | + v-if="scope.row.roleId !== 1" | ||
| 155 | + > | ||
| 156 | + <el-button | ||
| 157 | + link | ||
| 158 | + type="primary" | ||
| 159 | + icon="Edit" | ||
| 160 | + @click="handleUpdate(scope.row)" | ||
| 161 | + v-hasPermi="['system:role:edit']" | ||
| 162 | + ></el-button> | ||
| 120 | </el-tooltip> | 163 | </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> | 164 | + <el-tooltip |
| 165 | + content="删除" | ||
| 166 | + placement="top" | ||
| 167 | + v-if="scope.row.roleId !== 1" | ||
| 168 | + > | ||
| 169 | + <el-button | ||
| 170 | + link | ||
| 171 | + type="primary" | ||
| 172 | + icon="Delete" | ||
| 173 | + @click="handleDelete(scope.row)" | ||
| 174 | + v-hasPermi="['system:role:remove']" | ||
| 175 | + ></el-button> | ||
| 123 | </el-tooltip> | 176 | </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> | 177 | + <el-tooltip |
| 178 | + content="数据权限" | ||
| 179 | + placement="top" | ||
| 180 | + v-if="scope.row.roleId !== 1" | ||
| 181 | + > | ||
| 182 | + <el-button | ||
| 183 | + link | ||
| 184 | + type="primary" | ||
| 185 | + icon="CircleCheck" | ||
| 186 | + @click="handleDataScope(scope.row)" | ||
| 187 | + v-hasPermi="['system:role:edit']" | ||
| 188 | + ></el-button> | ||
| 126 | </el-tooltip> | 189 | </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> | 190 | + <el-tooltip |
| 191 | + content="分配用户" | ||
| 192 | + placement="top" | ||
| 193 | + v-if="scope.row.roleId !== 1" | ||
| 194 | + > | ||
| 195 | + <el-button | ||
| 196 | + link | ||
| 197 | + type="primary" | ||
| 198 | + icon="User" | ||
| 199 | + @click="handleAuthUser(scope.row)" | ||
| 200 | + v-hasPermi="['system:role:edit']" | ||
| 201 | + ></el-button> | ||
| 129 | </el-tooltip> | 202 | </el-tooltip> |
| 130 | </template> | 203 | </template> |
| 131 | </el-table-column> | 204 | </el-table-column> |
| @@ -148,7 +221,10 @@ | @@ -148,7 +221,10 @@ | ||
| 148 | <el-form-item prop="roleKey"> | 221 | <el-form-item prop="roleKey"> |
| 149 | <template #label> | 222 | <template #label> |
| 150 | <span> | 223 | <span> |
| 151 | - <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> | 224 | + <el-tooltip |
| 225 | + content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" | ||
| 226 | + placement="top" | ||
| 227 | + > | ||
| 152 | <el-icon><question-filled /></el-icon> | 228 | <el-icon><question-filled /></el-icon> |
| 153 | </el-tooltip> | 229 | </el-tooltip> |
| 154 | 权限字符 | 230 | 权限字符 |
| @@ -157,7 +233,11 @@ | @@ -157,7 +233,11 @@ | ||
| 157 | <el-input v-model="form.roleKey" placeholder="请输入权限字符" /> | 233 | <el-input v-model="form.roleKey" placeholder="请输入权限字符" /> |
| 158 | </el-form-item> | 234 | </el-form-item> |
| 159 | <el-form-item label="角色顺序" prop="roleSort"> | 235 | <el-form-item label="角色顺序" prop="roleSort"> |
| 160 | - <el-input-number v-model="form.roleSort" controls-position="right" :min="0" /> | 236 | + <el-input-number |
| 237 | + v-model="form.roleSort" | ||
| 238 | + controls-position="right" | ||
| 239 | + :min="0" | ||
| 240 | + /> | ||
| 161 | </el-form-item> | 241 | </el-form-item> |
| 162 | <el-form-item label="状态"> | 242 | <el-form-item label="状态"> |
| 163 | <el-radio-group v-model="form.status"> | 243 | <el-radio-group v-model="form.status"> |
| @@ -165,13 +245,26 @@ | @@ -165,13 +245,26 @@ | ||
| 165 | v-for="dict in sys_normal_disable" | 245 | v-for="dict in sys_normal_disable" |
| 166 | :key="dict.value" | 246 | :key="dict.value" |
| 167 | :label="dict.value" | 247 | :label="dict.value" |
| 168 | - >{{ dict.label }}</el-radio> | 248 | + >{{ dict.label }}</el-radio |
| 249 | + > | ||
| 169 | </el-radio-group> | 250 | </el-radio-group> |
| 170 | </el-form-item> | 251 | </el-form-item> |
| 171 | <el-form-item label="菜单权限"> | 252 | <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> | 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 | + > | ||
| 175 | <el-tree | 268 | <el-tree |
| 176 | class="tree-border" | 269 | class="tree-border" |
| 177 | :data="menuOptions" | 270 | :data="menuOptions" |
| @@ -184,7 +277,11 @@ | @@ -184,7 +277,11 @@ | ||
| 184 | ></el-tree> | 277 | ></el-tree> |
| 185 | </el-form-item> | 278 | </el-form-item> |
| 186 | <el-form-item label="备注"> | 279 | <el-form-item label="备注"> |
| 187 | - <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> | 280 | + <el-input |
| 281 | + v-model="form.remark" | ||
| 282 | + type="textarea" | ||
| 283 | + placeholder="请输入内容" | ||
| 284 | + ></el-input> | ||
| 188 | </el-form-item> | 285 | </el-form-item> |
| 189 | </el-form> | 286 | </el-form> |
| 190 | <template #footer> | 287 | <template #footer> |
| @@ -196,7 +293,12 @@ | @@ -196,7 +293,12 @@ | ||
| 196 | </el-dialog> | 293 | </el-dialog> |
| 197 | 294 | ||
| 198 | <!-- 分配角色数据权限对话框 --> | 295 | <!-- 分配角色数据权限对话框 --> |
| 199 | - <el-dialog :title="title" v-model="openDataScope" width="500px" append-to-body> | 296 | + <el-dialog |
| 297 | + :title="title" | ||
| 298 | + v-model="openDataScope" | ||
| 299 | + width="500px" | ||
| 300 | + append-to-body | ||
| 301 | + > | ||
| 200 | <el-form :model="form" label-width="80px"> | 302 | <el-form :model="form" label-width="80px"> |
| 201 | <el-form-item label="角色名称"> | 303 | <el-form-item label="角色名称"> |
| 202 | <el-input v-model="form.roleName" :disabled="true" /> | 304 | <el-input v-model="form.roleName" :disabled="true" /> |
| @@ -215,9 +317,21 @@ | @@ -215,9 +317,21 @@ | ||
| 215 | </el-select> | 317 | </el-select> |
| 216 | </el-form-item> | 318 | </el-form-item> |
| 217 | <el-form-item label="数据权限" v-show="form.dataScope == 2"> | 319 | <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> | 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 | + > | ||
| 221 | <el-tree | 335 | <el-tree |
| 222 | class="tree-border" | 336 | class="tree-border" |
| 223 | :data="deptOptions" | 337 | :data="deptOptions" |
| @@ -242,8 +356,20 @@ | @@ -242,8 +356,20 @@ | ||
| 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 => { | 432 | + listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then( |
| 433 | + (response) => { | ||
| 303 | roleList.value = response.rows; | 434 | roleList.value = response.rows; |
| 304 | total.value = response.total; | 435 | total.value = response.total; |
| 305 | loading.value = false; | 436 | loading.value = false; |
| 306 | - }); | 437 | + } |
| 438 | + ); | ||
| 307 | } | 439 | } |
| 308 | /** 搜索按钮操作 */ | 440 | /** 搜索按钮操作 */ |
| 309 | function handleQuery() { | 441 | function handleQuery() { |
| @@ -319,33 +451,45 @@ function resetQuery() { | @@ -319,33 +451,45 @@ 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 () { | 454 | + proxy.$modal |
| 455 | + .confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?') | ||
| 456 | + .then(function () { | ||
| 323 | return delRole(roleIds); | 457 | return delRole(roleIds); |
| 324 | - }).then(() => { | 458 | + }) |
| 459 | + .then(() => { | ||
| 325 | getList(); | 460 | getList(); |
| 326 | proxy.$modal.msgSuccess("删除成功"); | 461 | proxy.$modal.msgSuccess("删除成功"); |
| 327 | - }).catch(() => {}); | 462 | + }) |
| 463 | + .catch(() => {}); | ||
| 328 | } | 464 | } |
| 329 | /** 导出按钮操作 */ | 465 | /** 导出按钮操作 */ |
| 330 | function handleExport() { | 466 | function handleExport() { |
| 331 | - proxy.download("system/role/export", { | 467 | + proxy.download( |
| 468 | + "system/role/export", | ||
| 469 | + { | ||
| 332 | ...queryParams.value, | 470 | ...queryParams.value, |
| 333 | - }, `role_${new Date().getTime()}.xlsx`); | 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 () { | 484 | + proxy.$modal |
| 485 | + .confirm('确认要"' + text + '""' + row.roleName + '"角色吗?') | ||
| 486 | + .then(function () { | ||
| 345 | return changeRoleStatus(row.roleId, row.status); | 487 | return changeRoleStatus(row.roleId, row.status); |
| 346 | - }).then(() => { | 488 | + }) |
| 489 | + .then(() => { | ||
| 347 | proxy.$modal.msgSuccess(text + "成功"); | 490 | proxy.$modal.msgSuccess(text + "成功"); |
| 348 | - }).catch(function () { | 491 | + }) |
| 492 | + .catch(function () { | ||
| 349 | row.status = row.status === "0" ? "1" : "0"; | 493 | row.status = row.status === "0" ? "1" : "0"; |
| 350 | }); | 494 | }); |
| 351 | } | 495 | } |
| @@ -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 |
-
请 注册 或 登录 后发表评论