田源
2024-07-22 e38f4d12d2b051c42202d8554f4c92020d8be294
枚举类型导入,部门管理取消唯一标识列
已修改2个文件
161 ■■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/department/option.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
@@ -17,7 +17,8 @@
        <el-button icon="el-icon-plus" size="small" type="primary" @click="rowSaveHandlerClick">创建</el-button>
        <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">删除</el-button>
        <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">查看使用范围</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">下载导入模板</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">下载导入模板
        </el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">导出</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">导入</el-button>
      </template>
@@ -90,49 +91,64 @@
    <el-dialog
      v-dialogDrag
      v-loading="checkViewLoading"
      title="查看使用范围"
      :visible.sync="checkViewVisible"
      append-to-body="true"
      class="avue-dialog"
      title="查看使用范围"
      width="70%"
    >
    <avue-crud
      ref="checkViewCrud"
      :data="checkViewData"
      :option="checkViewOption"
      @search-change="checkHandleSearch"
      @search-reset="checkHandleReset"
    >
      <avue-crud
        ref="checkViewCrud"
        :data="checkViewData"
        :option="checkViewOption"
        @search-change="checkHandleSearch"
        @search-reset="checkHandleReset"
      >
    </avue-crud>
      </avue-crud>
    </el-dialog>
    <!--导入    -->
    <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" title="导入" @updata="getTableList"></upload-file>
    <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入"
                 @updata="getTableList"></upload-file>
  </basic-container>
</template>
<script>
import basicOption from '@/util/basic-option'
import {getEnumTypeList, addEnumType, updateEnumType, deleteEnumTypes,getUsedEnumList,download,downloadEnumTemplate} from "@/api/modeling/enumType/api";
import {
  getEnumTypeList,
  addEnumType,
  updateEnumType,
  deleteEnumTypes,
  getUsedEnumList,
  download,
  downloadEnumTemplate
} from "@/api/modeling/enumType/api";
import func from "@/util/func";
import {deleteUser} from "@/api/system/user/api";
export default {
  name: "index",
  data() {
    return {
      tipList:["导入模板中标明红色字体的为必输项","*注意*:第二行开始的数据为示例数据,导入前请将其删除,当导入的枚举下具备多个枚举项时,应按照示例enum2的写法",
        "枚举项名称(当前枚举下有枚举项时必填)","枚举值(当前枚举下有枚举项时必填)"],
      tipList: [
        "导入模板中标明红色字体的为必输项",
        "*注意*:第二行开始的数据为示例数据,导入前请将其删除,当导入的枚举下具备多个枚举项时,应按照示例enum2的写法",
        "枚举项名称(当前枚举下有枚举项时必填)",
        "枚举值(当前枚举下有枚举项时必填)",
        "导入一个枚举下的多个枚举项时,请将枚举名、标签、返回类型、等信息填写一致,再填写不同的枚举项"
      ],
      upFileType: ['xls', 'xlsx'],
      fileUrl: 'api/webEnumController/importEnumTypes',
      checkViewOption:{
      checkViewOption: {
        ...basicOption,
        addBtn:false,
        menu:false,
        addBtn: false,
        menu: false,
        searchMenuSpan: 8,
        refreshBtn: false,
        selection:false,
        column:[
        selection: false,
        column: [
          {
            label: '名称',
            prop: 'enumName',
@@ -142,7 +158,7 @@
            label: '来源',
            prop: 'source',
            sortable: true,
            search:true
            search: true
          },
          {
            label: '说明',
@@ -150,10 +166,10 @@
          }
        ]
      },
      checkViewData:[],
      checkViewDataSearch:[],
      checkViewVisible:false,
      checkViewLoading:false,
      checkViewData: [],
      checkViewDataSearch: [],
      checkViewVisible: false,
      checkViewLoading: false,
      editRow: {},
      dialogType: '',
      dialogData: [],
@@ -220,7 +236,7 @@
            label: '枚举名称',
            prop: 'id',
            sortable: true,
            search:true
            search: true
          },
          {
            label: '标签',
@@ -236,7 +252,7 @@
      },
      tableLoading: false,
      selectList: [],
      searchParams:{}
      searchParams: {}
    }
  },
  methods: {
@@ -258,9 +274,9 @@
    },
    // 搜索
    handleSearch(params,done) {
    handleSearch(params, done) {
      this.searchParams = {
        enumName:params.id
        enumName: params.id
      };
      this.getTableList()
      done();
@@ -325,29 +341,53 @@
        ts: row.ts
      }
      let data = [params];
      deleteEnumTypes(data).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
          this.getTableList();
        }
      })
      this.$confirm('您确定要删除当前的数据吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteEnumTypes(data).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTableList();
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // 多选删除
    allDelHandler() {
      let data = this.selectList.map(item => {
        return{
        return {
          oid: item.oid,
          name: item.id,
          ts: item.ts
        }
      })
      deleteEnumTypes(data).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
          this.getTableList();
        }
      })
      this.$confirm('您确定要删除所选择的数据吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteEnumTypes(data).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTableList();
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // 对话框枚举保存
@@ -473,18 +513,18 @@
    },
    // 查看使用范围
    chekView(){
      if(this.selectList.length <= 0 ){
    chekView() {
      if (this.selectList.length <= 0) {
        this.$message.warning('请至少选择一条数据');
        return;
      }
      if(this.selectList.length >1 ){
      if (this.selectList.length > 1) {
        this.$message.warning('只能选择一条数据进行查看');
        return;
      }
      getUsedEnumList({enumName:this.selectList[0].id}).then(res => {
        if(res.data.code === 200){
      getUsedEnumList({enumName: this.selectList[0].id}).then(res => {
        if (res.data.code === 200) {
          this.checkViewVisible = true;
          this.checkViewData = res.data.data;
          this.checkViewDataSearch = res.data.data;
@@ -494,12 +534,13 @@
    // 查看使用范围查询
    checkHandleSearch(params, done) {
      const { source } = params;
      const {source} = params;
      if(!params.source) {
      if (!params.source) {
        this.checkViewData = this.checkViewDataSearch;
        return done();
      };
      }
      ;
      this.checkViewData = this.checkViewData.filter(item => {
        return item.source && item.source.includes(source);
@@ -510,19 +551,19 @@
    },
    // 查看使用范围重置
    checkHandleReset(){
    checkHandleReset() {
      this.checkViewData = this.checkViewDataSearch;
    },
    // 导出
    downloadHandler(){
      if(this.selectList.length <= 0 ){
    downloadHandler() {
      if (this.selectList.length <= 0) {
        this.$message.warning('请至少选择一条数据进行导出');
        return;
      }
      let enumNames = this.selectList.map(item => item.id).join(',');
      download({enumNames:enumNames}).then(res => {
      download({enumNames: enumNames}).then(res => {
        func.downloadFileByBlobHandler(res);
        this.$message.success('导出成功');
      }).catch(err => {
@@ -531,7 +572,7 @@
    },
    // 下载导入模板
    downloadTemplateHandler(){
    downloadTemplateHandler() {
      downloadEnumTemplate().then(res => {
        func.downloadFileByBlobHandler(res);
        this.$message.success('下载成功');
@@ -540,7 +581,7 @@
      })
    },
    uploadUser(){
    uploadUser() {
      this.$refs.upload.visible = true;
    }
  }
Source/plt-web/plt-web-ui/src/views/system/department/option.js
@@ -23,11 +23,11 @@
    label:'专业',
    prop: 'specialties'
  },
  {
    label:'部门唯一标识ID',
    prop: 'uniqueId',
    display:false,
  },
  // {
  //   label:'部门唯一标识ID',
  //   prop: 'uniqueId',
  //   display:false,
  // },
  {
    label: '描述',
    prop: 'description',