优化IP形象管理,调整权限及界面
This commit is contained in:
		
							parent
							
								
									d9a89fac59
								
							
						
					
					
						commit
						65bafbfdc9
					
				| @ -14,6 +14,7 @@ export interface IpImageVO { | ||||
|    */ | ||||
|   shor: number; | ||||
| 
 | ||||
|   status: number; | ||||
|   /** | ||||
|    * 创建者 | ||||
|    */ | ||||
| @ -23,7 +24,6 @@ export interface IpImageVO { | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   createTime: string; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export interface IpImageForm extends BaseEntity { | ||||
| @ -42,10 +42,11 @@ export interface IpImageForm extends BaseEntity { | ||||
|    */ | ||||
|   shor?: number; | ||||
| 
 | ||||
|   status?: number; | ||||
|   ipUrl?: string; | ||||
| } | ||||
| 
 | ||||
| export interface IpImageQuery extends PageQuery { | ||||
| 
 | ||||
|   /** | ||||
|    * ip形象名称 | ||||
|    */ | ||||
| @ -60,7 +61,5 @@ export interface IpImageQuery extends PageQuery { | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
|   status?: number; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -1,265 +0,0 @@ | ||||
| <template> | ||||
|   <div class="p-2"> | ||||
|     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" | ||||
|       :leave-active-class="proxy?.animate.searchAnimate.leave"> | ||||
|       <div v-show="showSearch" class="mb-[10px]" id="search_div"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="用户ID" prop="userId"> | ||||
|               <el-input v-model="queryParams.userId" class="inputWidth" placeholder="请输入用户ID" clearable | ||||
|                 @keyup.enter="handleQuery" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="业务id" prop="sourceId"> | ||||
|               <el-input v-model="queryParams.sourceId" class="inputWidth" placeholder="请输入业务id" clearable | ||||
|                 @keyup.enter="handleQuery" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="来源类型(0=签到 1=发笔记 2=扔瓶子 3=评论 4=点赞 5=分享 6=收藏 7=地图点亮) " prop="source"> | ||||
|               <el-input v-model="queryParams.source" class="inputWidth" | ||||
|                 placeholder="请输入来源类型(0=签到 1=发笔记 2=扔瓶子 3=评论 4=点赞 5=分享 6=收藏 7=地图点亮) " clearable | ||||
|                 @keyup.enter="handleQuery" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="积分" prop="score"> | ||||
|               <el-input v-model="queryParams.score" class="inputWidth" placeholder="请输入积分" clearable | ||||
|                 @keyup.enter="handleQuery" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|               <!-- <el-button type="primary" plain icon="Plus" @click="handleAdd" | ||||
|                 v-hasPermi="['manage:userScore:add']">新增</el-button> | ||||
|               <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" | ||||
|                 v-hasPermi="['manage:userScore:edit']">修改</el-button> | ||||
|               <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" | ||||
|                 v-hasPermi="['manage:userScore:remove']">删除</el-button> --> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
|       </div> | ||||
|     </transition> | ||||
| 
 | ||||
|     <el-card shadow="never"> | ||||
|       <el-table v-loading="loading" :height="autoTableHeight" :data="userScoreList" | ||||
|         @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="ID" align="center" prop="id" v-if="true" /> | ||||
|         <el-table-column label="用户昵称" align="center" prop="nickName" /> | ||||
|         <el-table-column label="业务id" align="center" prop="sourceId" /> | ||||
|         <el-table-column label="来源类型(0=签到 1=发笔记 2=扔瓶子 3=评论 4=点赞 5=分享 6=收藏 7=地图点亮) " align="center" prop="source" /> | ||||
|         <el-table-column label="积分" align="center" prop="score" /> | ||||
|         <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||
|           <template #default="scope"> | ||||
|             <el-tooltip content="修改" placement="top"> | ||||
|               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|                 v-hasPermi="['manage:userScore:edit']"></el-button> | ||||
|             </el-tooltip> | ||||
|             <el-tooltip content="删除" placement="top"> | ||||
|               <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|                 v-hasPermi="['manage:userScore:remove']"></el-button> | ||||
|             </el-tooltip> | ||||
|           </template> | ||||
| </el-table-column> --> | ||||
|       </el-table> | ||||
| 
 | ||||
|       <pagination v-show="total > 0" id="table_page" :total="total" v-model:page="queryParams.pageNum" | ||||
|         v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|     </el-card> | ||||
|     <!-- 添加或修改积分记录对话框 --> | ||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> | ||||
|       <el-form ref="userScoreFormRef" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="用户ID" prop="userId"> | ||||
|           <el-input v-model="form.userId" placeholder="请输入用户ID" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="业务id" prop="sourceId"> | ||||
|           <el-input v-model="form.sourceId" placeholder="请输入业务id" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="来源类型(0=签到 1=发笔记 2=扔瓶子 3=评论 4=点赞 5=分享 6=收藏 7=地图点亮) " prop="source"> | ||||
|           <el-input v-model="form.source" placeholder="请输入来源类型(0=签到 1=发笔记 2=扔瓶子 3=评论 4=点赞 5=分享 6=收藏 7=地图点亮) " /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="积分" prop="score"> | ||||
|           <el-input v-model="form.score" placeholder="请输入积分" /> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
|           <el-button @click="cancel">取 消</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script setup name="UserScore" lang="ts"> | ||||
| import { listUserScore, getUserScore, delUserScore, addUserScore, updateUserScore } from '@/api/manage/userScore'; | ||||
| import { UserScoreVO, UserScoreQuery, UserScoreForm } from '@/api/manage/userScore/types'; | ||||
| 
 | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const autoTableHeight = ref(750); | ||||
| const userScoreList = ref<UserScoreVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| const loading = ref(true); | ||||
| const showSearch = ref(true); | ||||
| const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
| 
 | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const userScoreFormRef = ref<ElFormInstance>(); | ||||
| 
 | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
| }); | ||||
| 
 | ||||
| const initFormData: UserScoreForm = { | ||||
|   id: undefined, | ||||
|   userId: undefined, | ||||
|   sourceId: undefined, | ||||
|   source: undefined, | ||||
|   score: undefined, | ||||
| } | ||||
| const data = reactive<PageData<UserScoreForm, UserScoreQuery>>({ | ||||
|   form: {...initFormData}, | ||||
|   queryParams: { | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     userId: undefined, | ||||
|     sourceId: undefined, | ||||
|     source: undefined, | ||||
|     score: undefined, | ||||
|     params: { | ||||
|     } | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [ | ||||
|       { required: true, message: "ID不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     userId: [ | ||||
|       { required: true, message: "用户ID不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     sourceId: [ | ||||
|       { required: true, message: "业务id不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     source: [ | ||||
|       { required: true, message: "来源类型(0=签到 1=发笔记 2=扔瓶子 3=评论 4=点赞 5=分享 6=收藏 7=地图点亮) 不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     score: [ | ||||
|       { required: true, message: "积分不能为空", trigger: "blur" } | ||||
|     ], | ||||
|   } | ||||
| }); | ||||
| 
 | ||||
| const { queryParams, form, rules } = toRefs(data); | ||||
| 
 | ||||
| /** 查询积分记录列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await listUserScore(queryParams.value); | ||||
|   userScoreList.value = res.rows; | ||||
|   total.value = res.total; | ||||
|   loading.value = false; | ||||
| } | ||||
| 
 | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
|   reset(); | ||||
|   dialog.visible = false; | ||||
| } | ||||
| 
 | ||||
| /** 表单重置 */ | ||||
| const reset = () => { | ||||
|   form.value = {...initFormData}; | ||||
|   userScoreFormRef.value?.resetFields(); | ||||
| } | ||||
| 
 | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   getList(); | ||||
| } | ||||
| 
 | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value?.resetFields(); | ||||
|   handleQuery(); | ||||
| } | ||||
| 
 | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: UserScoreVO[]) => { | ||||
|   ids.value = selection.map(item => item.id); | ||||
|   single.value = selection.length != 1; | ||||
|   multiple.value = !selection.length; | ||||
| } | ||||
| 
 | ||||
| /** 新增按钮操作 */ | ||||
| const handleAdd = () => { | ||||
|   reset(); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = "添加积分记录"; | ||||
| } | ||||
| 
 | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = async (row?: UserScoreVO) => { | ||||
|   reset(); | ||||
|   const _id = row?.id || ids.value[0] | ||||
|   const res = await getUserScore(_id); | ||||
|   Object.assign(form.value, res.data); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = "修改积分记录"; | ||||
| } | ||||
| 
 | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   userScoreFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (valid) { | ||||
|       buttonLoading.value = true; | ||||
|       if (form.value.id) { | ||||
|         await updateUserScore(form.value).finally(() =>  buttonLoading.value = false); | ||||
|       } else { | ||||
|         await addUserScore(form.value).finally(() =>  buttonLoading.value = false); | ||||
|       } | ||||
|       proxy?.$modal.msgSuccess("操作成功"); | ||||
|       dialog.visible = false; | ||||
|       await getList(); | ||||
|     } | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (row?: UserScoreVO) => { | ||||
|   const _ids = row?.id || ids.value; | ||||
|   await proxy?.$modal.confirm('是否确认删除积分记录编号为"' + _ids + '"的数据项?').finally(() => loading.value = false); | ||||
|   await delUserScore(_ids); | ||||
|   proxy?.$modal.msgSuccess("删除成功"); | ||||
|   await getList(); | ||||
| } | ||||
| 
 | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = () => { | ||||
|   proxy?.download('manage/userScore/export', { | ||||
|     ...queryParams.value | ||||
|   }, `userScore_${new Date().getTime()}.xlsx`) | ||||
| } | ||||
| 
 | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
|   nextTick(() => { | ||||
|     autoTableHeight.value = proxy?.autoTableHeight(); | ||||
|   }); | ||||
|   window.onresize = () => { | ||||
|     autoTableHeight.value = proxy?.autoTableHeight(); | ||||
|   }; | ||||
| }); | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| .el-card :deep(.el-card__body) { | ||||
|   padding-bottom: 0px !important; | ||||
| } | ||||
| 
 | ||||
| #table_page { | ||||
|   height: 50px !important; | ||||
|   margin-top: 10px !important; | ||||
|   padding-bottom: 10px !important; | ||||
| } | ||||
| </style> | ||||
| @ -20,11 +20,11 @@ | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|               <el-button type="primary" plain icon="Plus" @click="handleAdd" | ||||
|                 v-hasPermi="['system:article:add']">新增</el-button> | ||||
|                 v-hasPermi="['manage:banner:add']">新增</el-button> | ||||
|               <!-- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" | ||||
|                 v-hasPermi="['system:article:edit']">修改</el-button> | ||||
|                 v-hasPermi="['manage:banner:edit']">修改</el-button> | ||||
|               <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" | ||||
|                 v-hasPermi="['system:article:remove']">删除</el-button> --> | ||||
|                 v-hasPermi="['manage:banner:remove']">删除</el-button> --> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
| @ -49,17 +49,17 @@ | ||||
|           </el-table-column> | ||||
|           <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px"> | ||||
|             <template #default="scope"> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 1">下架</el-button> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 0">上架</el-button> | ||||
|               <el-tooltip content="编辑" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|                   v-hasPermi="['system:article:edit']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:edit']"></el-button> | ||||
|               </el-tooltip> | ||||
|               <el-tooltip content="删除" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|                   v-hasPermi="['system:article:remove']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:remove']"></el-button> | ||||
|               </el-tooltip> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @ -82,17 +82,17 @@ | ||||
|           </el-table-column> | ||||
|           <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px"> | ||||
|             <template #default="scope"> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 1">下架</el-button> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 0">上架</el-button> | ||||
|               <el-tooltip content="编辑" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|                   v-hasPermi="['system:article:edit']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:edit']"></el-button> | ||||
|               </el-tooltip> | ||||
|               <el-tooltip content="删除" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|                   v-hasPermi="['system:article:remove']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:remove']"></el-button> | ||||
|               </el-tooltip> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @ -115,17 +115,17 @@ | ||||
|           </el-table-column> | ||||
|           <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px"> | ||||
|             <template #default="scope"> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 1">下架</el-button> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 0">上架</el-button> | ||||
|               <el-tooltip content="编辑" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|                   v-hasPermi="['system:article:edit']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:edit']"></el-button> | ||||
|               </el-tooltip> | ||||
|               <el-tooltip content="删除" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|                   v-hasPermi="['system:article:remove']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:remove']"></el-button> | ||||
|               </el-tooltip> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @ -153,17 +153,17 @@ | ||||
|           </el-table-column> | ||||
|           <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px"> | ||||
|             <template #default="scope"> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'0')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 1">下架</el-button> | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['system:article:edit']" | ||||
|               <el-button link type="primary" @click="putaway(scope.row,'1')" v-hasPermi="['manage:banner:edit']" | ||||
|                 v-if="scope.row.status == 0">上架</el-button> | ||||
|               <el-tooltip content="编辑" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|                   v-hasPermi="['system:article:edit']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:edit']"></el-button> | ||||
|               </el-tooltip> | ||||
|               <el-tooltip content="删除" placement="top" v-if="scope.row.status == 0"> | ||||
|                 <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|                   v-hasPermi="['system:article:remove']"></el-button> | ||||
|                   v-hasPermi="['manage:banner:remove']"></el-button> | ||||
|               </el-tooltip> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @ -240,7 +240,8 @@ const bannerFormRef = ref<ElFormInstance>(); | ||||
| 
 | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
|   title: '', | ||||
|   type:'' | ||||
| }); | ||||
| 
 | ||||
| const initFormData: BannerForm = { | ||||
|  | ||||
| @ -143,7 +143,8 @@ | ||||
|       <el-table-column width="90" label="操作人" align="center" prop="" /> | ||||
|       <el-table-column fixed="right" label="操作" min-width="120"> | ||||
|         <template #default="scope"> | ||||
|           <el-button link type="primary" size="small" @click="openbanned(scope.row)">封禁</el-button> | ||||
|           <el-button link type="primary" size="small" v-hasPermi="['manage:dyUser:edit']" | ||||
|             @click="openbanned(scope.row)">封禁</el-button> | ||||
|           <!-- <el-button link type="primary" size="small">权限</el-button> --> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|  | ||||
| @ -2,53 +2,49 @@ | ||||
|   <div class="p-2"> | ||||
|     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" | ||||
|       :leave-active-class="proxy?.animate.searchAnimate.leave"> | ||||
|       <div v-show="showSearch" class="mb-[10px]"> | ||||
|       <div v-show="showSearch" class="mb-[10px]" id="search_div"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="ip形象名称" prop="ipName"> | ||||
|               <el-input v-model="queryParams.ipName" placeholder="请输入ip形象名称" clearable @keyup.enter="handleQuery" /> | ||||
|             <el-form-item label="形象名称" prop="ipName"> | ||||
|               <el-input class="inputWidth" v-model="queryParams.ipName" placeholder="请输入ip形象名称" clearable | ||||
|                 @keyup.enter="handleQuery" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="排序" prop="shor"> | ||||
|               <el-input v-model="queryParams.shor" placeholder="请输入排序" clearable @keyup.enter="handleQuery" /> | ||||
|             <el-form-item label="发布状态" prop="status"> | ||||
|               <el-select v-model="queryParams.status" class="inputWidth" placeholder="请选择发布状态" clearable | ||||
|                 @keyup.enter="handleQuery"> | ||||
|                 <el-option label="已发布" :value="1" /> | ||||
|                 <el-option label="未发布" :value="0" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|               <el-button type="primary" plain icon="Plus" @click="handleAdd" | ||||
|                 v-hasPermi="['manage:ipImage:add']">新增</el-button> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
|       </div> | ||||
|     </transition> | ||||
| 
 | ||||
|     <el-card shadow="never"> | ||||
|       <template #header> | ||||
|         <el-row :gutter="10" class="mb8"> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="primary" plain icon="Plus" @click="handleAdd" | ||||
|               v-hasPermi="['manage:ipImage:add']">新增</el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" | ||||
|               v-hasPermi="['manage:ipImage:edit']">修改</el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" | ||||
|               v-hasPermi="['manage:ipImage:remove']">删除</el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" | ||||
|               v-hasPermi="['manage:ipImage:export']">导出</el-button> | ||||
|           </el-col> | ||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||
|         </el-row> | ||||
|       </template> | ||||
| 
 | ||||
|       <el-table v-loading="loading" :data="ipImageList" @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="ID" align="center" prop="id" v-if="true" /> | ||||
|     <el-table v-loading="loading" :height="autoTableHeight" border :data="ipImageList" | ||||
|       @selection-change="handleSelectionChange"> | ||||
|       <!-- <el-table-column type="selection" width="55" align="center" /> --> | ||||
|       <el-table-column label="ip形象名称" align="center" prop="ipName" /> | ||||
|       <el-table-column label="ip形象图片" align="center" prop="ipUrl"> | ||||
|         <template #default="scope"> | ||||
|           <image-preview :src="scope.row.productImageUrl" :width="50" :height="50" /> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="使用人数" align="center" prop="useCount" /> | ||||
|       <el-table-column label="排序" align="center" prop="shor" /> | ||||
|         <el-table-column label="创建者" align="center" prop="createBy" /> | ||||
|       <el-table-column label="发布状态" align="center" prop="status"> | ||||
|         <template #default="scope"> | ||||
|           <span>{{ scope.row.status == 1 ? '已发布' : '未发布'}}</span> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="创建者" align="center" prop="createName" /> | ||||
|       <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | ||||
|         <template #default="scope"> | ||||
|           <!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> --> | ||||
| @ -57,29 +53,35 @@ | ||||
|       </el-table-column> | ||||
|       <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||
|         <template #default="scope"> | ||||
|           <el-button link type="primary" @click="handleStatus(scope.row,1)" v-if="scope.row.status == 0" | ||||
|             v-hasPermi="['manage:ipImage:edit']">发布</el-button> | ||||
|           <el-button link type="primary" @click="handleStatus(scope.row,0)" v-if="scope.row.status==1" | ||||
|             v-hasPermi="['manage:ipImage:edit']">撤销发布</el-button> | ||||
|           <el-tooltip content="修改" placement="top"> | ||||
|               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|             <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-if="scope.row.status == 0" | ||||
|               v-hasPermi="['manage:ipImage:edit']"></el-button> | ||||
|           </el-tooltip> | ||||
|           <el-tooltip content="删除" placement="top"> | ||||
|               <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|             <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-if="scope.row.status == 0" | ||||
|               v-hasPermi="['manage:ipImage:remove']"></el-button> | ||||
|           </el-tooltip> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
| 
 | ||||
|       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" | ||||
|     <pagination v-show="total > 0" id="table_page" :total="total" v-model:page="queryParams.pageNum" | ||||
|       v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|     </el-card> | ||||
|     <!-- 添加或修改IP形象对话框 --> | ||||
|     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> | ||||
|       <el-form ref="ipImageFormRef" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="ip形象名称" prop="ipName"> | ||||
|         <el-form-item label="形象名称" prop="ipName"> | ||||
|           <el-input v-model="form.ipName" placeholder="请输入ip形象名称" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="排序" prop="shor"> | ||||
|           <el-input v-model="form.shor" placeholder="请输入排序" /> | ||||
|           <el-input-number v-model="form.shor" :min="1" :max="10000" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="形象图片" prop="ipUrl"> | ||||
|           <image-upload v-model="form.ipUrl" /> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
| @ -97,6 +99,7 @@ import { listIpImage, getIpImage, delIpImage, addIpImage, updateIpImage } from ' | ||||
| import { IpImageVO, IpImageQuery, IpImageForm } from '@/api/manage/ipImage/types'; | ||||
| 
 | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const autoTableHeight = ref(750); | ||||
| 
 | ||||
| const ipImageList = ref<IpImageVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| @ -112,13 +115,16 @@ const ipImageFormRef = ref<ElFormInstance>(); | ||||
| 
 | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
|   title: '', | ||||
|   type:'' | ||||
| }); | ||||
| 
 | ||||
| const initFormData: IpImageForm = { | ||||
|   id: undefined, | ||||
|   ipName: undefined, | ||||
|   shor: undefined, | ||||
|   shor: 1, | ||||
|   status:undefined, | ||||
|   ipUrl: undefined, | ||||
| } | ||||
| const data = reactive<PageData<IpImageForm, IpImageQuery>>({ | ||||
|   form: {...initFormData}, | ||||
| @ -127,19 +133,20 @@ const data = reactive<PageData<IpImageForm, IpImageQuery>>({ | ||||
|     pageSize: 10, | ||||
|     ipName: undefined, | ||||
|     shor: undefined, | ||||
|     status:undefined, | ||||
|     params: { | ||||
|     } | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [ | ||||
|       { required: true, message: "ID不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     ipName: [ | ||||
|       { required: true, message: "ip形象名称不能为空", trigger: "blur" } | ||||
|       { required: true, message: "形象名称不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     shor: [ | ||||
|       { required: true, message: "排序不能为空", trigger: "blur" } | ||||
|     ], | ||||
|     ipUrl: [ | ||||
|       { required: false, message: "形象不能为空", trigger: "change" } | ||||
|     ], | ||||
|   } | ||||
| }); | ||||
| 
 | ||||
| @ -202,6 +209,19 @@ const handleUpdate = async (row?: IpImageVO) => { | ||||
|   dialog.title = "修改IP形象"; | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 发布  撤销发布 | ||||
|  * @param row  | ||||
|  * @param status  | ||||
|  */ | ||||
| const handleStatus = async (row?: IpImageVO, status?: number) => { | ||||
|   await proxy?.$modal.confirm(`确定要${status == 1 ? '发布' : '撤销发布'}IP形象为"${row?.ipName}"的数据项吗?`).finally(() => loading.value = false); | ||||
|   Object.assign(form.value, row); | ||||
|   form.value.status = status; | ||||
|   await updateIpImage(form.value); | ||||
|   proxy?.$modal.msgSuccess(`${status == 1 ? '发布' : '撤销发布'}成功`); | ||||
|   await getList(); | ||||
| } | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   ipImageFormRef.value?.validate(async (valid: boolean) => { | ||||
| @ -210,6 +230,7 @@ const submitForm = () => { | ||||
|       if (form.value.id) { | ||||
|         await updateIpImage(form.value).finally(() =>  buttonLoading.value = false); | ||||
|       } else { | ||||
|         form.value.status = 0; | ||||
|         await addIpImage(form.value).finally(() =>  buttonLoading.value = false); | ||||
|       } | ||||
|       proxy?.$modal.msgSuccess("操作成功"); | ||||
| @ -237,5 +258,22 @@ const handleExport = () => { | ||||
| 
 | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
|   nextTick(() => { | ||||
|     autoTableHeight.value = proxy?.autoTableHeight(); | ||||
|   }); | ||||
|   window.onresize = () => { | ||||
|     autoTableHeight.value = proxy?.autoTableHeight(); | ||||
|   }; | ||||
| }); | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| .el-card :deep(.el-card__body) { | ||||
|   padding-bottom: 0px !important; | ||||
| } | ||||
| 
 | ||||
| #table_page { | ||||
|   height: 50px !important; | ||||
|   margin-top: 10px !important; | ||||
|   padding-bottom: 10px !important; | ||||
| } | ||||
| </style> | ||||
|  | ||||
| @ -151,7 +151,8 @@ const productFormRef = ref<ElFormInstance>(); | ||||
| 
 | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
|   title: '', | ||||
|   type: '' | ||||
| }); | ||||
| 
 | ||||
| const initFormData: ProductForm = { | ||||
|  | ||||
| @ -137,7 +137,8 @@ const wishParams = reactive({ | ||||
| }) | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
|   title: '', | ||||
|   type: '' | ||||
| }); | ||||
| const makeWish = reactive({ | ||||
|   visible: false, | ||||
|  | ||||
| @ -46,14 +46,15 @@ | ||||
|               </el-select> | ||||
|             </el-form-item> --> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button type="primary" icon="Search" v-hasPermi="['manage:content:query']" | ||||
|                 @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|               <el-button type="primary" plain icon="Plus" @click="handleAdd" | ||||
|                 v-hasPermi="['system:article:add']">新增</el-button> | ||||
|                 v-hasPermi="['manage:content:add']">新增</el-button> | ||||
|               <!-- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" | ||||
|                 v-hasPermi="['system:article:edit']">修改</el-button> | ||||
|                 v-hasPermi="['manage:content:edit']">修改</el-button> | ||||
|               <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" | ||||
|                 v-hasPermi="['system:article:remove']">删除</el-button> --> | ||||
|                 v-hasPermi="['manage:content:remove']">删除</el-button> --> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
| @ -135,16 +136,16 @@ | ||||
|       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="170px"> | ||||
|         <template #default="scope"> | ||||
|           <el-button link type="primary" v-if="scope.row.status == 0" @click="updateRow(scope.row, '2')" | ||||
|             v-hasPermi="['system:article:edit']">发布</el-button> | ||||
|             v-hasPermi="['manage:content:edit']">发布</el-button> | ||||
|           <el-button link type="primary" v-if="scope.row.status == 2" @click="updateRow(scope.row, '0')" | ||||
|             v-hasPermi="['system:article:edit']">撤销发布</el-button> | ||||
|             v-hasPermi="['manage:content:edit']">撤销发布</el-button> | ||||
|           <el-tooltip content="修改" placement="top" v-if="scope.row.status == 0||scope.row.status == 3"> | ||||
|             <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" | ||||
|               v-hasPermi="['system:article:edit']"></el-button> | ||||
|               v-hasPermi="['manage:content:edit']"></el-button> | ||||
|           </el-tooltip> | ||||
|           <el-tooltip content="删除" placement="top" v-if="scope.row.status == 0||scope.row.status == 3"> | ||||
|             <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" | ||||
|               v-hasPermi="['system:article:remove']"></el-button> | ||||
|               v-hasPermi="['manage:content:remove']"></el-button> | ||||
|           </el-tooltip> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|  | ||||
| @ -21,7 +21,8 @@ | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button type="primary" icon="Search" v-hasPermi="['manage:userLevel:query']" | ||||
|                 @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|               <el-button type="primary" plain icon="Plus" @click="handleAdd" | ||||
|                 v-hasPermi="['manage:userLevel:add']">新增</el-button> | ||||
|  | ||||
| @ -86,7 +86,8 @@ const userScoreFormRef = ref<ElFormInstance>(); | ||||
| 
 | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
|   title: '', | ||||
|   type: '', | ||||
| }); | ||||
| 
 | ||||
| const initFormData: UserScoreForm = { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user