fjl
fujunling
2023-06-19 1f5527cadc5101fcc4cf895bb476171d25413235
fjl
已修改6个文件
已添加1个文件
452 ■■■■ 文件已修改
Source/UBCS-WEB/src/api/batchImport/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/BatchImport/index.vue 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/batchImport/index.js
@@ -4,7 +4,7 @@
// åŽ†å²å¯¼å…¥æ¨¡æ¿ä¸‹è½½
export const downloadHistoryImportTemplate = (params) => {
  return request({
    url: '/api/ubcs-code/mdmEngineController/downloadTopImportExcel',
    url: '/api/ubcs-code/mdmEngineController/downloadImportExcelHistory',
    method: 'get',
    params
  })
Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,238 @@
<template>
  <el-dialog
    :title="title"
    :visible="dialogVisible"
    width="1200px"
    append-to-body
  >
    <div class="flex_box">
      <div class="left" :style="{ width: leftWidth }">
        <div class="isExpand_box">
          <el-link type="primary" @click="hideTree">
            <i
              :class="isExpand ? 'el-icon-arrow-left' : 'el-icon-arrow-right'"
            ></i>
            {{ isExpand ? "收缩" : "展开" }}
          </el-link>
        </div>
        <el-input
          placeholder="输入关键字进行过滤"
          v-model="filterText"
          size="small"
          v-show="isExpand"
        >
        </el-input>
        <el-tree
          v-show="isExpand"
          class="filter_tree"
          :data="data"
          default-expand-all
          :filter-node-method="filterNode"
          ref="tree"
        >
        </el-tree>
      </div>
      <div class="right">
        <div class="tab_box">
          <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
            <el-tab-pane label="正确数据" name="success">
              <el-table border :data="successData"></el-table>
            </el-tab-pane>
            <el-tab-pane label="有相似项或者错误数据" name="error">
              <el-table border :data="errorData"></el-table>
            </el-tab-pane>
          </el-tabs>
        </div>
      </div>
    </div>
    <template #footer>
      <div>
        <el-button size="small" type="primary">确定导入</el-button>
        <el-button size="small">取消</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script>
export default {
  name: "ShowImportData",
  props: {
    title: {
      type: String,
      default: "历史数据导入",
    },
    visible: false,
  },
  computed: {
    dialogVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        this.$emit("update:visible", val);
      },
    },
  },
  data() {
    return {
      isExpand: true,
      filterText: "",
      leftWidth: "200px",
      data: [
        {
          id: 1,
          label: "一级 1",
          children: [
            {
              id: 4,
              label: "二级 1-1",
              children: [
                {
                  id: 9,
                  label: "三级 1-1-1",
                },
                {
                  id: 10,
                  label: "三级 1-1-2",
                },
              ],
            },
          ],
        },
        {
          id: 2,
          label: "一级 2",
          children: [
            {
              id: 5,
              label: "二级 2-1",
            },
            {
              id: 6,
              label: "二级 2-2",
            },
          ],
        },
        {
          id: 3,
          label: "一级 3",
          children: [
            {
              id: 7,
              label: "二级 3-1",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
            {
              id: 8,
              label: "二级 3-2",
            },
          ],
        },
      ],
      successData: [],
      errorData: [],
    };
  },
  methods: {
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    hideTree() {
      if (this.isExpand) {
        this.leftWidth = "50px";
      } else {
        this.leftWidth = "200px";
      }
      this.isExpand = !this.isExpand;
    },
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
  },
};
</script>
<style lang="scss" scoped>
.flex_box {
  display: flex;
  .left {
    transition: all 0.3s;
    .isExpand_box {
      margin-bottom: 10px;
      text-align: right;
    }
    .filter_tree {
      max-height: 400px;
      overflow-y: scroll;
    }
  }
}
</style>
Source/UBCS-WEB/src/components/BatchImport/index.vue
@@ -1,51 +1,63 @@
<template>
  <el-dialog :title="title" :visible="visible" append-to-body>
    <Divider text="导入提示" left="30px"></Divider>
    <ul>
      <li v-for="(item, index) in tipList" :key="index">
        {{ item }}
      </li>
    </ul>
    <div class="radio_box">
      <span>分类的路径使用的属性:</span>
      <el-radio-group v-model="classifyAttr">
        <el-radio label="id">分类编号</el-radio>
        <el-radio label="name">分类名称</el-radio>
      </el-radio-group>
    </div>
    <Divider text="excel文件,选择文件后会自动上传" left="30px"></Divider>
    <el-upload
      class="upload"
      :accept="accept"
      :action="action"
      :before-upload="beforeUpload"
      :on-exceed="handleExceed"
      :headers="uploadHeaders"
      :on-success="onSuccess"
      :show-file-list="false"
      :data="{
        codeClassifyOid: this.codeClassifyOid,
        classifyAttr: this.classifyAttr,
      }"
    >
      <el-button size="small" type="primary"
        ><i class="el-icon-upload"></i> ç‚¹å‡»ä¸Šä¼ </el-button
  <div>
    <el-dialog :title="title" :visible="visible" append-to-body>
      <Divider text="导入提示" left="30px"></Divider>
      <ul>
        <li v-for="(item, index) in tipList" :key="index">
          {{ item }}
        </li>
      </ul>
      <div class="radio_box">
        <span>分类的路径使用的属性:</span>
        <el-radio-group v-model="classifyAttr">
          <el-radio label="id">分类编号</el-radio>
          <el-radio label="name">分类名称</el-radio>
        </el-radio-group>
      </div>
      <Divider text="excel文件,选择文件后会自动上传" left="30px"></Divider>
      <el-upload
        class="upload"
        :accept="accept"
        :action="action"
        :before-upload="beforeUpload"
        :on-exceed="handleExceed"
        :headers="uploadHeaders"
        :on-success="onSuccess"
        :show-file-list="false"
        :data="{
          codeClassifyOid: this.codeClassifyOid,
          classifyAttr: this.classifyAttr,
        }"
      >
    </el-upload>
    <template #footer>
      <el-button type="primary" size="small" @click="downloadTemplateFun" :loading="downloadLoading"
        >下载导入模板</el-button
      >
      <el-button size="small">关闭</el-button>
    </template>
  </el-dialog>
        <el-button size="small" type="primary"
          ><i class="el-icon-upload"></i> ç‚¹å‡»ä¸Šä¼ </el-button
        >
      </el-upload>
      <template #footer>
        <el-button
          type="primary"
          size="small"
          @click="downloadTemplateFun"
          :loading="downloadLoading"
          >下载导入模板</el-button
        >
        <el-button size="small" @click="visible = false">关闭</el-button>
      </template>
    </el-dialog>
    <ShowImportData :visible="showVisible" v-if="showVisible"></ShowImportData>
  </div>
</template>
<script>
import { downloadHistoryImportTemplate, downloadErrorFile } from "../../api/batchImport/index";
import ShowImportData from "./ShowImportData.vue";
import {
  downloadHistoryImportTemplate,
  downloadErrorFile,
} from "../../api/batchImport/index";
import { getToken } from "@/util/auth";
export default {
  name: "",
  name: "BatchImport",
  components: { ShowImportData },
  props: {
    visible: {
      type: Boolean,
@@ -68,7 +80,8 @@
    return {
      classifyAttr: "id",
      uploadParams: {},
      downloadLoading: false
      downloadLoading: false,
      showVisible: false,
    };
  },
  computed: {
@@ -109,30 +122,32 @@
    },
    // ä¸‹è½½å¯¼å…¥æ¨¡æ¿
    downloadTemplateFun() {
      this.downloadLoading = true
      this.downloadLoading = true;
      downloadHistoryImportTemplate({
        codeClassifyOid: "535FC9B6-FE27-241F-5FCA-ED4DC17CF95B",
      }).then(res => {
        this.downloadLoading = false
        console.log(res);
      }).catch(() => {
        this.downloadLoading = false
      });
      })
        .then((res) => {
          this.downloadLoading = false;
          console.log(res);
        })
        .catch(() => {
          this.downloadLoading = false;
        });
    },
    onSuccess(res) {
      if (res.code === 400) {
        this.$message.error(`${res.msg},请下载错误信息进行查看!`)
        this.$message.error(`${res.msg},请下载错误信息进行查看!`);
      }
      downloadErrorFile({uuid: res.data.fileOid})
    }
      downloadErrorFile({ uuid: res.data.fileOid });
    },
  },
  watch: {
    visible: {
      immediate:true,
      immediate: true,
      handler() {
        this.getDataByType();
      }
    }
      },
    },
  },
};
</script>
Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue
@@ -517,6 +517,7 @@
            collapse: true,
            column: [],
          });
          return
        }
        if (
          formItem.type === "combox" &&
@@ -596,7 +597,7 @@
      this.$set(this.option, "column", column);
      this.$set(this.option, "group", group);
      this.formIndex++;
      if (this.type === 'add') {
      if (this.type === 'add' || this.type === 'preview') {
        this.loading = false;
      }
      this.geDictData(dictKeys);
@@ -652,11 +653,11 @@
      if (type === "truefalse") {
        return [
          {
            key: false,
            key: 'false',
            value: "否",
          },
          {
            key: true,
            key: 'true',
            value: "是",
          },
        ];
@@ -700,7 +701,7 @@
    },
    // èŽ·å–è¡¨å•è¯¦æƒ…æ•°æ®
    getFormDetail() {
      if (this.type === 'add') return
      if (this.type === 'add' || this.type === 'preview') return
      getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }).then(
        (res) => {
          this.form = Object.assign(this.form, res.data.data[0])
Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue
@@ -70,11 +70,7 @@
    type: {
      type: String,
      default: "add",
    },
    form: {
      type: Object,
      default: () => ({}),
    },
    }
  },
  data() {
    return {
@@ -82,8 +78,8 @@
      activeName: "findlike",
      tableData: [],
      loading: false,
      resembleTemplateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
      resembleCodeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
      resembleTemplateOid: "",
      resembleCodeClassifyOid: "",
      rowOid: '',
      defaultValue: {},
      secVOList: [],
Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue
@@ -22,7 +22,7 @@
</template>
<script>
import { getFormTemplate } from "@/api/formTemplate";
import { getFormTemplate, getFormDetail } from "@/api/formTemplate";
import ResembleQuery from "./ResembleQuery";
export default {
  name: "ResembleQueryDialog",
@@ -40,6 +40,7 @@
      type: String,
      default: "",
    },
    rowOid: "",
    codeRuleOid: {
      type: String,
      default: "",
@@ -56,7 +57,8 @@
  data() {
    return {
      column: [],
      loading: false
      loading: false,
      detailData: {},
    };
  },
  computed: {
@@ -71,23 +73,28 @@
  },
  methods: {
    openDialog() {
      this.loading = true
      getFormTemplate({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
      }).then((res) => {
        this.loading = false
        if (
          res.data &&
          res.data.resembleTableVO.cols &&
          res.data.resembleTableVO.cols.length > 0
        ) {
          this.column = res.data.resembleTableVO.cols;
          this.$refs.ResembleQuery.resembleQuery();
        } else {
          this.column = [];
        }
      });
      this.loading = true;
      getFormDetail({ templateOid: this.templateOid, oid: this.rowOid })
        .then((res) => {
          this.detailData = res.data.data[0] || {};
          return getFormTemplate({
            templateOid: this.templateOid,
            codeClassifyOid: this.codeClassifyOid,
          });
        })
        .then((res) => {
          this.loading = false;
          if (
            res.data &&
            res.data.resembleTableVO.cols &&
            res.data.resembleTableVO.cols.length > 0
          ) {
            this.column = res.data.resembleTableVO.cols;
            this.$refs.ResembleQuery.resembleQuery(this.detailData);
          } else {
            this.column = [];
          }
        });
    },
  },
};
Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue
@@ -6,20 +6,21 @@
    <el-button @click="visible2 = true">附件管理dialog</el-button>
    <FormTemplateDialog
      :visible.sync="visible"
      :type="this.type"
      :templateOid="this.templateOid"
      :codeClassifyOid="this.codeClassifyOid"
      :codeRuleOid="this.codeRuleOid"
      :type="type"
      :templateOid="templateOid"
      :codeClassifyOid="codeClassifyOid"
      :codeRuleOid="codeRuleOid"
      :disabledProp="disabledProp"
      :rowOid="rowOid"
      @submit="submit"
    ></FormTemplateDialog>
    <ResembleQueryDialog
      :visible.sync="visible1"
      :type="this.type"
      :templateOid="this.templateOid"
      :codeClassifyOid="this.codeClassifyOid"
      :codeRuleOid="this.codeRuleOid"
      :type="type"
      :templateOid="templateOid"
      :codeClassifyOid="codeClassifyOid"
      :rowOid="rowOid"
      :codeRuleOid="codeRuleOid"
    ></ResembleQueryDialog>
    <BatchImport
      :visible="visible3"
@@ -52,11 +53,11 @@
      // é»˜è®¤ç¦ç”¨çš„表元素
      disabledProp: ["id", "lcstatus"],
      // è¡¨å•类型
      type: "add",
      templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
      type: "edit",
      templateOid: "f441b131-5ea0-4672-ab74-735b11161928",
      codeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
      codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96",
      rowOid: "6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9",
      rowOid: "551FBA49-9A94-2F83-9126-9DD4F9BB14B5",
    };
  },
  methods: {