Selaa lähdekoodia

项目及公告功能完善

zmq 1 vuosi sitten
vanhempi
commit
e4bbd7015c

+ 20 - 1
src/api/admin/data-contracts.ts

@@ -4682,6 +4682,10 @@ export interface ProjectAddInput {
   videoUrl: string
   /** 详情 */
   detail: string 
+  /** 详情纯文本 */
+  detailText: string 
+  /**热词 */
+  hotWords: string  
   // 项目价格
   prices: ProjectPriceAddInput[]
 }
@@ -4721,6 +4725,11 @@ export interface ProjectUpdateInput {
   videoUrl: string
   /** 详情 */
   detail: string
+  /** 详情纯文本 */
+  detailText: string   
+  /**热词 */
+  hotWords: string 
+
   // 项目价格
   prices: ProjectPriceAddInput[]
 }
@@ -4766,6 +4775,11 @@ export interface NoticeAddInput {
    * @minLength 1
    */
   content: string
+  /**
+   * 纯文本内容
+   * @minLength 1
+   */
+  desc: string
   /** 排序 */
   rank: number
   /** 是否弹窗 1弹窗 0不弹窗 */
@@ -4785,7 +4799,12 @@ export interface NoticeUpdateInput {
    * 内容
    * @minLength 1
    */
-  content: string
+  content: string,
+  /**
+   * 纯文本内容
+   * @minLength 1
+   */
+  desc: string
   /** 排序 */
   rank: number
   /** 是否弹窗 1弹窗 0不弹窗 */

+ 5 - 4
src/views/admin/notice/alternotice.vue

@@ -60,6 +60,7 @@ const onQuery = async () => {
         if (res.data != null) {
             state.form = res.data as NoticeAddInput & NoticeUpdateInput;
             state.editor.htmlVal = state.form.content;
+            state.editor.textVal = state.form.desc;
         } else { 
             state.form = {} as NoticeAddInput & NoticeUpdateInput
         }
@@ -68,15 +69,15 @@ const onQuery = async () => {
 }
 
 // 确定
-const onSure = () => {
-    if (state.editor.textVal!="")
-        state.form.content = state.editor.htmlVal;    
+const onSure = () => {       
+    state.form.content = state.editor.htmlVal;    
+    state.form.desc = state.editor.textVal;
     formRef.value.validate(async (valid: boolean) => {        
         if (!valid) return        
         state.sureLoading = true
         state.form.isAlter = 1;
         state.form.rank = 0;
-        state.form.title='重要通知'
+        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(() => {                

+ 2 - 0
src/views/admin/notice/components/notice-form.vue

@@ -92,6 +92,7 @@ const open = async (row: any = {}) => {
     if (res?.success) {
       state.form = res.data as NoticeAddInput & NoticeUpdateInput        
       state.editor.htmlVal = state.form.content;      
+      state.editor.textVal = state.form.desc;      
     }
   } else {
     state.form = {} as NoticeAddInput & NoticeUpdateInput
@@ -114,6 +115,7 @@ const onSure = () => {
     if (!valid) return
 
     state.form.content = state.editor.htmlVal;
+    state.form.desc = state.editor.textVal;      
 
     state.sureLoading = true
     let res = {} as any

+ 15 - 4
src/views/admin/project/components/project-form.vue

@@ -33,7 +33,9 @@
           </el-col>
           <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
             <el-form-item label="结算周期" prop="settleDay" :rules="[{ required: true, message: '请输入结算周期', trigger: ['blur', 'change'] }]">
-              <el-input v-model="form.settleDay" autocomplete="off" />
+              <el-input v-model="form.settleDay" autocomplete="off" >
+                 <template v-slot:prepend>T</template>
+              </el-input>
             </el-form-item>
           </el-col>          
           <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
@@ -41,6 +43,16 @@
               <el-input v-model="form.maxPrice" autocomplete="off" />
             </el-form-item>
           </el-col>
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <el-form-item label="项目热词" prop="hotWords" :rules="[{ required: true, message: '请输入项目热词', trigger: ['blur', 'change'] }]">
+                <el-input v-model="form.hotWords" autocomplete="off" placeholder="请输入热词使用英文逗号分割(最多5个)"/>
+              </el-form-item>
+            </el-col>          
+            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <el-form-item label="视频教程" prop="videoUrl">
+                <el-input v-model="form.videoUrl" autocomplete="off" />
+              </el-form-item>
+            </el-col>
           <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <el-form-item label="项目简介" prop="tips" :rules="[{ required: true, message: '请输入项目简介', trigger: ['blur', 'change'] }]">
                 <el-input v-model="form.tips" clearable type="textarea" />
@@ -137,9 +149,7 @@ const state = reactive({
     htmlVal: '',
     textVal: '',
     disable: false,
-  }, numberValidateForm: {
-    age: ''
-  }  
+  } 
 })
 const { form } = toRefs(state)
 
@@ -212,6 +222,7 @@ const onCancel = () => {
 // 确定
 const onSure = () => {
   state.form.detail = state.editor.htmlVal;
+  state.form.detailText = state.editor.textVal;
   
   formRef.value.validate(async (valid: boolean) => {    
     if (!valid) return

+ 1 - 0
src/views/admin/project/index.vue

@@ -113,6 +113,7 @@ const onAdd = () => {
 }
 
 const onEdit = (row: ProjectListOutput) => {
+    console.log(row);
     proxy.$modal.msgError("待开发");
     // state.ProjectFormTitle = '编辑项目'
     // projectFormRef.value.open(row)