ludc
2023-07-28 3c58e215ed1c075c3a7729c899335c99d35c3f56
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
ÎļþÃû´Ó Source/UBCS-WEB/src/components/Tree/classifyTrees.vue ÐÞ¸Ä
@@ -16,7 +16,7 @@
            <div style="display: flex; margin-top: 10px">
              <el-button plain size="small" type="primary" @click="Enable">启用</el-button>
              <el-button plain size="small" type="primary" @click="Deactivate">停用</el-button>
              <el-button plain size="small" type="primary" @click="ImportExcel">导入</el-button>
              <el-button plain size="small" type="primary" @click.native="ImportExcel">导入</el-button>
              <el-button plain size="small" type="primary" @click="ExportExcel">导出</el-button>
            </div>
          </div>
@@ -312,6 +312,8 @@
            </div>
          </div>
        </el-dialog>
<!--        å¯¼å‡º-->
          <ThemeImport :visible.sync="ThemeImportVisible" :codeClassifyOid="this.codeClassifyOid"></ThemeImport>
      </basic-container>
    </el-main>
  </el-container>
@@ -335,9 +337,11 @@
  copy,
  upVersion,
  stopLose,
  startRelease
  startRelease,
  exportClassify
} from "@/api/template/templateAttr";
import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master'
import func from "@/util/func";
export default {
  name: "classifyTrees.vue",
  //使用inject接收参数
@@ -346,6 +350,8 @@
  inject: ["crudTreeData"],
  data() {
    return {
      //导入状态框
      ThemeImportVisible:false,
      selectRow:'',
      //树节点显示隐藏
      TreeFlagCode:false,
@@ -677,7 +683,7 @@
            label: '',
            prop: 'radio',
            width: 60,
            hide: false,
            display: false
          },
          {
            label: "模板编号",
@@ -711,18 +717,33 @@
            prop:"lcStatusText",
            display:false
          }
        ]
        ],
        batchImportData: {
          visible: false,
          type: '',
          codeClassifyOid: ''
      }
    }
    }
  },
  created() {
  },
  methods: {
    /** å¯¼å…¥ */
    ImportExcel(){
      this.ThemeImportVisible=true;
    },
    /** å¯¼å‡º */
    ExportExcel(){
      if(this.nodeClickList){
        exportClassify({oid:this.nodeClickList.oid}).then(res=>{
          console.log(res)
          func.downloadFileByBlob(res);
        })
      }else {
        this.$message.warning('请先选择要导出的主题库分类')
      }
    },
    //模板管理已发布编辑
    // checkShowEditBtn() {
@@ -1109,6 +1130,9 @@
    //启用和停用都先判断状态
    //启用
    Enable() {
      if(Object.keys(this.nodeClickList).length<1){
        this.$message.warning('请先从树上选择一条数据')
      }else {
      if (this.FlagObj.lcStatus == "Enabled") {
        this.$message({
          type: 'warning',
@@ -1134,9 +1158,14 @@
          });
        });
      }
      }
    },
    //停用
    Deactivate() {
      if(Object.keys(this.nodeClickList).length<1){
        this.$message.warning('请先从树上选择一条数据')
      }else {
      if (this.FlagObj.lcStatus === "Disabled") {
        this.$message({
          type: 'warning',
@@ -1163,15 +1192,19 @@
          });
        });
      }
      }
    },
    //树点击事件
    async nodeClick(data) {
      //定义一个模板属性id,数据是模板管理表格里面的oid
      if(data.parentId == ""){
        this.TreeFlagCode=true;
      }
      this.nodeClickList = data
      this.ProData=[]
      this.ProData=[];
      this.selectRow=0;
      try {
        await TreeObjcet(data.oid).then(res => {
          this.FlagObj = res.data.data