Browse Source

公告需求更新

zmq 1 year ago
parent
commit
c4b4e49c70

+ 2 - 0
src/api/admin/data-contracts.ts

@@ -4791,6 +4791,7 @@ export interface NoticeAddInput {
   /** 是否弹窗 1弹窗 0不弹窗 */
   isAlter: number
   tags: string
+  isShow:number
   
 }
 /** 修改公告 */
@@ -4816,6 +4817,7 @@ export interface NoticeUpdateInput {
   /** 是否弹窗 1弹窗 0不弹窗 */
   isAlter: number
   tags: string
+  isShow: number
   /**
   * 主键Id
   * @format int64

+ 3 - 3
src/views/admin/banner/components/banner-form.vue

@@ -19,9 +19,9 @@
           <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <el-form-item label="跳转方式">
                 <el-select v-model="form.skipWay" prop="skipWay" placeholder="跳转方式">                  
-                  <el-option label="请选择" value="0"></el-option>
-                  <el-option label="文章详情" value="1"></el-option>
-                  <el-option label="项目详情" value="2"></el-option>
+                  <el-option label="请选择" :value="0"></el-option>
+                  <el-option label="文章详情" :value="1"></el-option>
+                  <el-option label="项目详情" :value="2"></el-option>
                 </el-select>                
               </el-form-item>
             </el-col>                                          

+ 20 - 11
src/views/admin/notice/alternotice.vue

@@ -8,6 +8,18 @@
                             <Editor v-model:get-html="state.editor.htmlVal" v-model:get-text="state.editor.textVal" :disable="state.editor.disable" />
                           </el-form-item>
                         </el-col>
+                        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">                             
+                            <el-form-item>
+                                注:首页弹窗重要通知,最新内容在最上面编写
+                            </el-form-item>
+                        </el-col>
+                        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">                             
+                            <el-form-item>
+                                <span style="margin-right: 10px;">首页重要通知弹框:</span>
+                                <el-radio v-model="state.form.isShow" :label="1" >开启</el-radio>
+                                <el-radio v-model="state.form.isShow" :label="0">关闭</el-radio>
+                            </el-form-item>
+                        </el-col>
                     </el-row>
                     <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                         <el-form-item size="large">
@@ -45,13 +57,12 @@ const state = reactive({
     },
 })
 
-onMounted(() => {
+onMounted(() => {    
     onQuery();    
-
 })
 
 // 查询重要通知
-const onQuery = async () => {    
+const onQuery = async () => {         
     const res = await new NoticeApi().getWeight({ }, { loading: true }).catch(() => {
         proxy.$modal.closeLoading()
     })
@@ -63,9 +74,9 @@ const onQuery = async () => {
             state.editor.textVal = state.form.desc;
         } else { 
             state.form = {} as NoticeAddInput & NoticeUpdateInput
+            state.form.isShow = 1;
         }
-        
-    }    
+    }
 }
 
 // 确定
@@ -80,18 +91,16 @@ const onSure = () => {
         state.form.title = '重要通知'
         let res = {} as any
         if (state.form.id != undefined && state.form.id > 0) {
-            res = await new NoticeApi().update(state.form, { showSuccessMessage: true }).catch(() => {                
-                state.sureLoading = false
+            res = await new NoticeApi().update(state.form, { showSuccessMessage: true }).catch(() => {                                
             })
         } else {
-            res = await new NoticeApi().add(state.form, { showSuccessMessage: true }).catch(() => {                
-                state.sureLoading = false
+            res = await new NoticeApi().add(state.form, { showSuccessMessage: true }).catch(() => {                                
             })
         }
         if (res?.success) {
             onQuery();
-            state.sureLoading = false
-        }
+        } 
+        state.sureLoading = false
     }) 
 }
 </script>

+ 16 - 13
src/views/admin/project/components/project-form.vue

@@ -14,8 +14,8 @@
           <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <el-form-item label="项目类型" prop="projectType" :rules="[{ required: true, message: '请输入项目类型', trigger: ['blur', 'change'] }]">                
                 <el-select placeholder="选择项目类型" v-model="form.projectType" clearable >                                         
-                    <el-option label="二维码拉新项目" value="1" checked></el-option>                        
-                    <el-option label="夸克拉新项目" value="2" ></el-option>                        
+                    <el-option label="二维码拉新项目" :value="1" checked></el-option>                        
+                    <el-option label="夸克拉新项目" :value="2" ></el-option>                        
                 </el-select>
               </el-form-item>
             </el-col>
@@ -67,7 +67,7 @@
               </el-form-item>
           </el-col>          
           <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <el-form-item label="项目价格">              
+            <el-form-item label="项目价格" v-if="state.buttontype==0">              
                 <el-form :inline="true" ref="PriceformRef" :model="state.formPrice" class="demo-form-inline">
                     <el-form-item prop="name" :rules="[{ required: true, message: '请输入结算标准', trigger: ['blur', 'change'] }]">
                       <el-input v-model="state.formPrice.name" autocomplete="off" placeholder="结算标准" ></el-input>
@@ -81,12 +81,12 @@
                     </el-form-item>
                 </el-form>
             </el-form-item>
-            <el-form-item label="" prop="prices" :rules="[{ required: true, message: '请添加项目价格', trigger: ['blur', 'change'] }]">
+            <el-form-item label="价格列表" prop="prices" :rules="[{ required: true, message: '请添加项目价格', trigger: ['blur', 'change'] }]">
                 <el-table :data="state.form.prices" row-key="id" height="'100%'" style="width: 100%; height: 100%">
                 <el-table-column type="index" width="80" label="序号"></el-table-column>                                
                 <el-table-column prop="name" label="结算标准" min-width="140" show-overflow-tooltip/>                  
                 <el-table-column prop="price" label="价格" width="100" show-overflow-tooltip/>                
-                <el-table-column label="操作" width="140" header-align="center" align="center" fixed="right">
+                <el-table-column label="操作" width="140" header-align="center" align="center" fixed="right" v-if="state.buttontype == 0">
                     <template #default="{row}">
                         <el-button size="small" text type="primary" @click="onPriceDelete(row)">删除</el-button>                        
                     </template>
@@ -103,7 +103,7 @@
         </el-row>
       </el-form>
       
-      <template #footer>
+      <template #footer v-if="state.buttontype==0">
         <span class="dialog-footer">
           <el-button @click="onCancel" size="default">取 消</el-button>
           <el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
@@ -115,7 +115,7 @@
 
 <script lang="ts" setup name="admin/project/form">
 import { reactive, toRefs, getCurrentInstance, ref, computed, defineAsyncComponent } from 'vue'
-import { ProjectAddInput, TenantUpdateInput } from '/@/api/admin/data-contracts'
+import { ProjectAddInput, ProjectUpdateInput } from '/@/api/admin/data-contracts'
 import { ProjectApi } from '/@/api/admin/project'
 import type { UploadInstance, UploadProps, UploadFile } from 'element-plus'
 import eventBus from '/@/utils/mitt'
@@ -145,7 +145,7 @@ const PriceformRef = ref()
 const state = reactive({  
   showDialog: false,
   sureLoading: false,  
-  form: {} as ProjectAddInput & TenantUpdateInput,
+  form: {} as ProjectAddInput & ProjectUpdateInput,
   fileList: [] as UploadFile[],
   fileDirectory:'project',
   token: storesUserInfo.getToken(),
@@ -157,24 +157,27 @@ const state = reactive({
     htmlVal: '',
     textVal: '',
     disable: false,
-  } 
+  },
+  buttontype:0
 })
 const { form } = toRefs(state)
 
 
 // 打开对话框
-const open = async (row: any = {}) => {  
-
+const open = async (row: any = {},buttontype:number=0) => {  
+  state.buttontype = buttontype
   if (row.id > 0) {
     const res = await new ProjectApi().get({ id: row.id }, { loading: true }).catch(() => {
       proxy.$modal.closeLoading()
     })
 
     if (res?.success) {
-      state.form = res.data as ProjectAddInput & TenantUpdateInput
+      state.form = res.data as ProjectAddInput & ProjectUpdateInput
+      state.editor.htmlVal = state.form.detail
+      state.editor.textVal = state.form.detailText      
     }
   } else {
-    state.form = {  } as ProjectAddInput & TenantUpdateInput
+    state.form = {  } as ProjectAddInput & ProjectUpdateInput
   }
   state.showDialog = true
 }

+ 21 - 7
src/views/admin/project/index.vue

@@ -40,7 +40,8 @@
                 <el-table-column prop="statusText" label="状态" width="120" show-overflow-tooltip />             
                 <el-table-column label="操作" width="180" header-align="center" align="center" fixed="right"> 
                     <template #default="{ row }">                        
-                        <el-button v-auth="'api:admin:project:update'" icon="ele-EditPen" size="small" text type="primary" @click="onEdit(row)">编辑</el-button>
+                        <el-button size="small" text type="primary" @click="onDetail(row)">详情</el-button>
+                        <!-- <el-button v-auth="'api:admin:project:update'" icon="ele-EditPen" size="small" text type="primary" @click="onEdit(row)">编辑</el-button> -->
                         <el-button v-auth="'api:admin:project:update-status'" v-if="row.status == 1" size="small" text type="primary" @click="onEditStatus(row,2,'上架')">上架</el-button>
                         <el-button v-auth="'api:admin:project:update-status'" v-if="row.status == 2" size="small" text type="primary" @click="onEditStatus(row,4, '暂停')">暂停</el-button>
                         <el-button v-auth="'api:admin:project:update-status'" v-if="row.status == 4" size="small" text type="primary" @click="onEditStatus(row,2, '恢复')">恢复</el-button>
@@ -80,7 +81,7 @@ const state = reactive({
     total: 0,
     filter: {
         keywrods: '',
-        status: 0
+        status: ''
     },
     pageInput: {
         currentPage: 1,
@@ -102,8 +103,16 @@ onBeforeMount(() => {
 })
 
 const onQuery = async () => {
-    state.loading = true
-    state.pageInput.filter = state.filter
+    state.loading = true    
+    let filter1 = {
+        keywrods: state.filter.keywrods,
+        status:state.filter.status
+    };        
+    if (filter1.status == '')
+        filter1.status = '0';
+
+    state.pageInput.filter = filter1    
+    
     const res = await new ProjectApi().getPage(state.pageInput).catch(() => {
         state.loading = false
     })
@@ -119,9 +128,14 @@ const onAdd = () => {
 }
 
 const onEdit = (row: ProjectListOutput) => {    
-    proxy.$modal.msgError("待开发");
-    // state.ProjectFormTitle = '编辑项目'
-    // projectFormRef.value.open(row)
+    // proxy.$modal.msgError("待开发");
+    state.ProjectFormTitle = '编辑项目'
+    projectFormRef.value.open(row)
+}
+const onDetail = (row: ProjectListOutput) => {
+    // proxy.$modal.msgError("待开发");
+    state.ProjectFormTitle = `【${row.name}】详情`
+    projectFormRef.value.open(row,1)
 }
 
 const onEditStatus = (row: ProjectListOutput, status: number, statusText: string) => {