bug
This commit is contained in:
		
							parent
							
								
									b8f643abe0
								
							
						
					
					
						commit
						b0665d6d40
					
				| @ -87,29 +87,30 @@ | |||||||
|         <el-table-column label="发布状态" align="center" prop="status"> |         <el-table-column label="发布状态" align="center" prop="status"> | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag> |             <el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag> | ||||||
|             <el-tag v-if="scope.row.status == 1" type="success">审核中</el-tag> |             <el-tag v-if="scope.row.status == 1" type="warning">草稿</el-tag> | ||||||
|             <el-tag v-if="scope.row.status == 2" type="primary">发布</el-tag> |             <el-tag v-if="scope.row.status == 2" type="success">审核中</el-tag> | ||||||
|  |             <el-tag v-if="scope.row.status == 3" type="primary">已发布</el-tag> | ||||||
| 
 | 
 | ||||||
|             <!-- <image-preview :src="scope.row.productImageUrl" /> --> |             <!-- <image-preview :src="scope.row.productImageUrl" /> --> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column label="操作人" align="center" prop="updateByName" show-overflow-tooltip /> |         <el-table-column label="操作人" align="center" prop="updateByName" show-overflow-tooltip /> | ||||||
|         <el-table-column label="操作时间" align="center" prop="updateTime" width="200px" /> |         <el-table-column label="操作时间" align="center" prop="updateTime" width="200px" /> | ||||||
|         <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px" > | ||||||
|           <template #default="scope"> |           <template #default="scope"> | ||||||
|             <el-button v-if="scope.row.status != 2" v-hasPermi="['manage:notebook:edit']" link type="primary" @click="handleUpdate(scope.row)" |             <el-button v-if="scope.row.status == 0||scope.row.status == 1" v-hasPermi="['manage:notebook:edit']" link type="primary" @click="handleUpdate(scope.row)" | ||||||
|               >编辑</el-button |               >编辑</el-button | ||||||
|             > |             > | ||||||
|             <el-button v-if="scope.row.status != 2" v-hasPermi="['manage:notebook:edit']" link type="primary" @click="fabudata(scope.row)" |             <el-button v-if="scope.row.status == 0" v-hasPermi="['manage:notebook:edit']" link type="primary" @click="fabudata(scope.row)" | ||||||
|               >发布</el-button |               >发布</el-button | ||||||
|             > |             > | ||||||
|             <el-button v-if="scope.row.status == 2" v-hasPermi="['manage:notebook:edit']" link type="primary" @click="fabudata(scope.row)" |             <el-button v-if="scope.row.status == 3" v-hasPermi="['manage:notebook:edit']" link type="primary" @click="fabudata(scope.row)" | ||||||
|               >撤销发布</el-button |               >撤销发布</el-button | ||||||
|             > |             > | ||||||
|             <!--            <el-tooltip content="发布" placement="top">--> |             <!--            <el-tooltip content="发布" placement="top">--> | ||||||
|             <!--              <el-button v-hasPermi="['manage:notebook:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>--> |             <!--              <el-button v-hasPermi="['manage:notebook:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>--> | ||||||
|             <!--            </el-tooltip>--> |             <!--            </el-tooltip>--> | ||||||
|             <el-button v-if="scope.row.status != 2" v-hasPermi="['manage:notebook:remove']" link type="primary" @click="handleDelete(scope.row)" |             <el-button v-if="scope.row.status == 0||scope.row.status == 1" v-hasPermi="['manage:notebook:remove']" link type="primary" @click="handleDelete(scope.row)" | ||||||
|               >删除</el-button |               >删除</el-button | ||||||
|             > |             > | ||||||
|           </template> |           </template> | ||||||
| @ -145,11 +146,11 @@ | |||||||
|         <div style="display: flex; justify-content: space-between"> |         <div style="display: flex; justify-content: space-between"> | ||||||
|           <div> |           <div> | ||||||
|             <el-button :loading="buttonLoading" type="primary" @click="yulansave">预 览</el-button> |             <el-button :loading="buttonLoading" type="primary" @click="yulansave">预 览</el-button> | ||||||
|             <el-button @click="cancel">存草稿</el-button> |             <el-button @click="submitForm('1')">存草稿</el-button> | ||||||
|           </div> |           </div> | ||||||
|           <div> |           <div> | ||||||
|             <el-button @click="cancel">取 消</el-button> |             <el-button @click="cancel">取 消</el-button> | ||||||
|             <el-button :loading="buttonLoading" type="primary" @click="submitForm">提 交</el-button> |             <el-button :loading="buttonLoading" type="primary" @click="submitForm('3')">提 交</el-button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </template> |       </template> | ||||||
| @ -222,20 +223,12 @@ const props = defineProps({ | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| const addressvalue = ref(''); | const addressvalue = ref(''); | ||||||
| const statusoptions = [ | const statusoptions =  ref([ | ||||||
|   { |   { label: '已发布', value: 3 }, | ||||||
|     value: '1', |   { label: '审核中', value: 2 }, | ||||||
|     label: '审核中' |   { label: '未发布', value: 0 }, | ||||||
|   }, |   { label: '草稿', value: 1 } | ||||||
|   { | ]); | ||||||
|     value: '2', |  | ||||||
|     label: '已发布' |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     value: '0', |  | ||||||
|     label: '未发布' |  | ||||||
|   } |  | ||||||
| ]; |  | ||||||
| const dialog = reactive<DialogOption>({ | const dialog = reactive<DialogOption>({ | ||||||
|   visible: false, |   visible: false, | ||||||
|   title: '' |   title: '' | ||||||
| @ -418,27 +411,42 @@ const contenttext = async (row?: NotebookVO) => { | |||||||
|   concentdialog.visible = true; |   concentdialog.visible = true; | ||||||
| }; | }; | ||||||
| /** 提交按钮 */ | /** 提交按钮 */ | ||||||
| const submitForm = () => { | const submitForm = async(type) => { | ||||||
|   form.value.tagId = tagvalue.value.join(','); |   form.value.tagId = tagvalue.value.join(','); | ||||||
|   form.value.location = addressvalue.value.join(','); |   form.value.location = addressvalue.value.join(','); | ||||||
|   form.value.cover = ''; |   form.value.cover = ''; | ||||||
|   form.value.status = 1; |   form.value.status = Number(type); | ||||||
|   form.value.content = form.value.content == '<p><br></p>' ? '' : form.value.content; |   form.value.content = form.value.content == '<p><br></p>' ? '' : form.value.content; | ||||||
|   notebookFormRef.value?.validate(async (valid: boolean) => { |   if(type == 1){ | ||||||
|     if (valid) { |     buttonLoading.value = true; | ||||||
|       buttonLoading.value = true; |     if (form.value.id) { | ||||||
|       if (form.value.id) { |       await updateNotebook(form.value).finally(() => (buttonLoading.value = false)); | ||||||
|         await updateNotebook(form.value).finally(() => (buttonLoading.value = false)); |     } else { | ||||||
|       } else { |       await addNotebook(form.value).finally(() => (buttonLoading.value = false)); | ||||||
|         await addNotebook(form.value).finally(() => (buttonLoading.value = false)); |  | ||||||
|       } |  | ||||||
|       console.log(form.value.cover); |  | ||||||
| 
 |  | ||||||
|       proxy?.$modal.msgSuccess('操作成功'); |  | ||||||
|       dialog.visible = false; |  | ||||||
|       await getList(); |  | ||||||
|     } |     } | ||||||
|   }); |     console.log(form.value.cover); | ||||||
|  | 
 | ||||||
|  |     proxy?.$modal.msgSuccess('操作成功'); | ||||||
|  |     await getList(); | ||||||
|  |   }else{ | ||||||
|  |     notebookFormRef.value?.validate(async (valid: boolean) => { | ||||||
|  |       if (valid) { | ||||||
|  |         buttonLoading.value = true; | ||||||
|  |         if (form.value.id) { | ||||||
|  |           await updateNotebook(form.value).finally(() => (buttonLoading.value = false)); | ||||||
|  |         } else { | ||||||
|  |           await addNotebook(form.value).finally(() => (buttonLoading.value = false)); | ||||||
|  |         } | ||||||
|  |         console.log(form.value.cover); | ||||||
|  | 
 | ||||||
|  |         proxy?.$modal.msgSuccess('操作成功'); | ||||||
|  |         dialog.visible = false; | ||||||
|  |         await getList(); | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| /** 删除按钮操作 */ | /** 删除按钮操作 */ | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user