gaoshp
2024-06-02 b46e6d2306515f94bf77c06e8d80ac76267e3ddb
src/views/configuration/custom/planSettings.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-05-29 17:32:55
 * @LastEditTime: 2024-05-30 18:17:23
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -12,7 +12,16 @@
         <div class="title">计划显示设置</div>
         <div class="type">
            <div class="item last" @click="openPlan">新建计划类型模版</div>
            <div :class="{item:true, activeTab:index == 0?true:false}" v-for="(item,index) in planData">{{item.templateName}}<span>...</span></div>
            <div :class="{item:true, activeTab: item.active}" v-for="(item,index) in planData" @click="changePlanData(item,index)">
               <span style="margin-right: 12px;cursor: pointer;">{{item.templateName}}</span>
               <el-popover placement="right-start" :width="30" trigger="click" :hide-after="0" :show-after="0">
                  <template #reference>...</template>
                  <template #default>
                     <span class="popvoer-title" @click="table_edit(item,index)">编辑</span>
                     <span  class="popvoer-title" style="margin-left: 12px" v-if="index != 0" @click="del_tab(item)">删除</span>
                  </template>
               </el-popover>
            </div>
         </div>
      </div>
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
@@ -69,6 +78,7 @@
      name: "custom",
      data(){
         return {
            id: "",
            dialog: {
               save: false
            },
@@ -101,14 +111,38 @@
            this.$HTTP.get(`/api/blade-system/custom-template/list?businessType=${this.$route.query.type}`).then(res=> {
               if(res.code == 200) {
                  this.planData = res.data.reverse();
                  this.id = this.planData[0].id;
                  this.planData[0].active = true;
                  this.getTableList();
               }
            })
         },
         changePlanData(row,index) {
            this.id = row.id;
            this.planData.forEach(item=> {
               item.active = false;
            })
            this.planData[index].active = true;
            this.getTableList();
         },
         getTableList() {
            this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=1&templateId=${this.planData[0].id}`).then(res=> {
            this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=1&templateId=${this.id}`).then(res=> {
               if(res.code == 200) {
                  this.tableData0 = res.data.systemFieldList;
               }
            })
         },
         table_edit(row) {
            this.dialog.save = true
            this.$nextTick(() => {
               this.$refs.saveDialog.open(this.productList,this.planData,'edit').setData(row);
            })
         },
         del_tab(row) {
            this.$HTTP.delete(`/api/blade-system/custom-template/remove`,[row.id]).then(res=> {
               if(res.code == 200) {
                  this.$message.success("操作成功");
                  this.getBaseData();
               }
            })
         },
@@ -183,4 +217,7 @@
    color: #000;
    margin: 14px 0;
}
.popvoer-title {
   cursor: pointer;
}
</style>