田源
2023-07-28 0bd98f8ac6eb537e618ad00c8bc3f3b40e46ab69
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
ÎļþÃû´Ó Source/UBCS-WEB/src/components/Tree/classifyTrees.vue ÐÞ¸Ä
@@ -312,6 +312,8 @@
            </div>
          </div>
        </el-dialog>
<!--        <BatchImport v-if="batchImportData.visible" v-bind="batchImportData" :visible.sync="batchImportData.visible" >-->
<!--        </BatchImport>-->
      </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接收参数
@@ -711,18 +715,35 @@
            prop:"lcStatusText",
            display:false
          }
        ]
        ],
        batchImportData: {
          visible: false,
          type: '',
          codeClassifyOid: ''
        }
      }
    }
  },
  created() {
  },
  methods: {
    /** å¯¼å…¥ */
    ImportExcel(){
      // debugger
      // this.batchImportData.visible = true
      // this.batchImportData.codeClassifyOid = this.codeClassifyOid
    },
    /** å¯¼å‡º */
    ExportExcel(){
      if(this.nodeClickList){
        exportClassify({oid:this.nodeClickList.oid}).then(res=>{
          console.log(res)
          func.downloadFileByBlob(res);
        })
      }else {
        this.$message.warning('请先选择要导出的主题库分类')
      }
    },
    //模板管理已发布编辑
    // checkShowEditBtn() {
@@ -1109,60 +1130,70 @@
    //启用和停用都先判断状态
    //启用
    Enable() {
      if (this.FlagObj.lcStatus == "Enabled") {
        this.$message({
          type: 'warning',
          message: '当前分类不是停用状态'
        });
      } else {
        this.$confirm('是否将子分类一并启用?', '提示', {
          confirmButtonText: '是',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          TreeEnable(this.nodeClickList).then(() => {
            this.$message({
              type: 'success',
              message: '启用成功!'
            });
            this.getAttr()
          })
        }).catch(() => {
      if(Object.keys(this.nodeClickList).length<1){
        this.$message.warning('请先从树上选择一条数据')
      }else {
        if (this.FlagObj.lcStatus == "Enabled") {
          this.$message({
            type: 'info',
            message: '已取消启用'
            type: 'warning',
            message: '当前分类不是停用状态'
          });
        });
        } else {
          this.$confirm('是否将子分类一并启用?', '提示', {
            confirmButtonText: '是',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            TreeEnable(this.nodeClickList).then(() => {
              this.$message({
                type: 'success',
                message: '启用成功!'
              });
              this.getAttr()
            })
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消启用'
            });
          });
        }
      }
    },
    //停用
    Deactivate() {
      if (this.FlagObj.lcStatus === "Disabled") {
        this.$message({
          type: 'warning',
          message: '当前分类不是启用状态!'
        });
      } else {
        this.$confirm('是否停用当前分类,停用后,子分类也将不能被使用,是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          TreeDeactivate(this.nodeClickList).then(() => {
            this.$message({
              type: 'success',
              message: '停用成功!'
            });
            this.nodeClickList['flag'] = true;
            this.getAttr()
          })
        }).catch(() => {
      if(Object.keys(this.nodeClickList).length<1){
        this.$message.warning('请先从树上选择一条数据')
      }else {
        if (this.FlagObj.lcStatus === "Disabled") {
          this.$message({
            type: 'info',
            message: '已取消停用'
            type: 'warning',
            message: '当前分类不是启用状态!'
          });
        });
        } else {
          this.$confirm('是否停用当前分类,停用后,子分类也将不能被使用,是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            TreeDeactivate(this.nodeClickList).then(() => {
              this.$message({
                type: 'success',
                message: '停用成功!'
              });
              this.nodeClickList['flag'] = true;
              this.getAttr()
            })
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消停用'
            });
          });
        }
      }
    },
    //树点击事件
    async nodeClick(data) {