fujunling
2023-05-29 d0867c4d6a3a608b12002bf873a3616fdcf91dfe
动态表单
已修改4个文件
已添加2个文件
853 ■■■■ 文件已修改
Source/UBCS-WEB/src/api/common.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/formTemplate.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/FindLike.vue 636 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/index.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/util/func.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/common.js
@@ -12,10 +12,3 @@
  })
}
export const getFormTemplate = (params) => {
  return request({
    url: 'api/ubcs-code/ubcs-code/mdmEngineController/getFormDefineByTemplateOid',
    method: 'get',
    params
  })
}
Source/UBCS-WEB/src/api/formTemplate.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
import request from "@/router/axios";
// èŽ·å–è¡¨å•æ¨¡æ¿æ•°æ®
export const getFormTemplate = (params) => {
  return request({
    url: 'api/ubcs-code/ubcs-code/mdmEngineController/getFormDefineByTemplateOid',
    method: 'get',
    params
  })
}
// è¡¨å•数据执行代码
export const executeCode = (params) => {
  return request({
    url: 'api/ubcs-code/ubcs-code/mdmEngineController/getFormDefineByTemplateOid',
    method: 'get',
    params
  })
}
// ç›¸ä¼¼é¡¹æŸ¥è¯¢
export const findLike = (data) => {
  return request({
    url: 'api/mdmEngineController/resembleQuery',
    method: 'post',
    data
  })
}
Source/UBCS-WEB/src/components/FormTemplate/FindLike.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,636 @@
<template>
  <div v-if="visible">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="相似项数据" name="findlike">
        <el-table
          :data="tableData"
          v-loading="loading"
          height="250"
          :border="true"
        >
          <el-table-column
            v-for="item in column"
            :key="item.prop"
            :prop="item.prop"
            :label="item.label"
          >
            <template #default="{ row }">
              <el-button type="text" @click="openFormTemlpate(row)">{{
                row.id
              }}</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <FormTemplate
      type="detail"
      :visible.sync="templateVisible"
      templateOid="78B8C7C5-A042-0B96-FE6D-65421451782A"
      codeClassifyOid="4524E801-6CC6-92E8-1AC3-2AB9604E8F96"
    ></FormTemplate>
  </div>
</template>
<script>
import { findLike } from "@/api/formTemplate";
import FormTemplate from "./index.vue";
export default {
  name: "FindLike",
  components: { FormTemplate },
  props: {
    column: {
      type: Array,
      default: () => [{ prop: "id", label: "代号" }],
    },
  },
  data() {
    return {
      visible: false,
      templateVisible: false,
      activeName: 'findlike',
      tableData: [
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "C2FD69E0-59CA-7A3C-D3BE-A95AB67F81D4",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "5052756D-CE43-8F30-AE6B-A4F4102A66C5",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:53:06.637",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:53:06.637",
          nameoid: "69E5E86F-AD62-1DBE-05D3-E0CE4C07408F",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:53:06.637",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "C33464B7-79A8-095B-D6FC-F9EB2EA0C985",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "4AF61981-D2E8-D8A2-9704-D12B043C22D1",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:51:06.262",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:51:06.262",
          nameoid: "53E9B351-C410-2A78-3DC0-159BB3E695F9",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:51:06.262",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "00813CDD-4066-5FF5-0AAF-4AFCDB0C2CAE",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "47E45EAF-74E3-C722-3FCA-8FC8F996684F",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:41:14.965",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:41:14.965",
          nameoid: "0AA8ACA8-1961-A670-93C5-744DCFF64238",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:41:14.965",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "413C9BA4-877D-AC01-554D-4DF3CCC0CCA5",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "E2F85B5B-9812-0A03-59D1-F4A48BCDA20B",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:38:11.315",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:38:11.315",
          nameoid: "231D873D-ADF0-1E46-5E02-A2C0C1667324",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:38:11.315",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "99E22C15-228E-E64B-E0F4-BB699CF1E686",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test1223",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "A750F940-B2EA-DB08-5240-1379FE34E9C1",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:26:31.626",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:26:31.626",
          nameoid: "B38F560F-38EF-4E80-A843-0EF0556DBE1A",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:26:31.626",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "0D8A595E-962C-E88A-1B75-CCBA29675B7A",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "80602381-F29D-E6A3-9DD4-FEF211DB8EAA",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:20:08.311",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:20:08.311",
          nameoid: "DBDF377F-F7CF-67BA-673B-D8DE7E6D6587",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:20:08.311",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "3EFB6B91-E320-58DD-8402-956E9D416D2C",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "0B6D7C29-DE6A-9D81-BC11-EB39D454877F",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 21:16:24.964",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 21:16:24.964",
          nameoid: "3B3C476A-74E2-FF4A-7228-01D1F1EA18B8",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 21:16:24.964",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "F3EB357A-1285-6BED-105E-4E4F1230CB76",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "247CF179-AA18-E636-F66E-054BF1A4A03C",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 20:28:37.591",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 20:28:37.591",
          nameoid: "F95AF399-F100-8CD0-F944-DE528F8DFC93",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 20:28:37.591",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "610F9365-8E6E-699F-07A0-BC35601BD952",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "9DBE4C77-D0E6-4326-621D-EA9AACD86AD4",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 20:27:05.35",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 20:27:05.35",
          nameoid: "B1B51981-A1D9-20A0-F974-5A61C1B9F3FF",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 20:27:05.35",
        },
        {
          lastmodifier: "1(业务测试)",
          revisionseq: "1",
          versionvalue: "1",
          secondfl: "",
          versionseq: "1",
          checkinby: "",
          firstfl: "",
          jiliangdwname: "",
          materialtype: "1001",
          materialtypeText: "材料",
          chukufangshi: "先进先出",
          hesuanfenlei: "",
          lctid: "wupinLC",
          id: "******",
          isfirstv: "1",
          revisionoid: "7AF39DAB-A6EA-C0E0-303F-BD8B493553AE",
          checkouttime: "",
          btmname: "wupin",
          codeclsfid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          revisionvalue: "1",
          secretgradeText: "普通商密",
          name: "",
          secretgrade: "2",
          isfirstr: "1",
          xinghaoguige: "",
          materialname: "test12",
          codetemplateoid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
          description: "",
          oid: "CD5EF43C-41E5-A0AC-42B1-BBEE6535AE1C",
          thrifl: "",
          revisionrule: "numberversionrule",
          lcstatus_text: "编辑中",
          oldcode: "223",
          hesuanfenleiname: "",
          codeclsfpath:
            "D9CF223F-317D-71EB-BD11-433A94CAD9F3##535FC9B6-FE27-241F-5FCA-ED4DC17CF95B##8EB35A1D-AB8B-2255-565C-84D309E0C62B##4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
          owner: "1",
          xiaoshouwl: "false",
          checkoutby: "",
          creator: "1(业务测试)",
          createtime: "2023-04-12 20:25:28.642",
          tuhao: "yy002",
          beizhushuoming: "",
          versionrule: "0",
          jiliangdw: "个",
          islastr: "1",
          copyfromversion: "",
          materialclassify: "",
          lastmodifytime: "2023-04-12 20:25:28.642",
          nameoid: "9BC308A8-35D7-49FD-4E49-B93CB21E22A3",
          lcstatus: "Editing",
          islastv: "1",
          checkintime: "",
          ts: "2023-04-12 20:25:28.642",
        },
      ],
      loading: false,
      templateOid: "",
      codeClassifyOid: "",
    };
  },
  methods: {
    findLinkClick(data) {
      this.visible = true;
      // findLike(data).then((res) => {
      //   this.tableData = res.data.data
      // });
    },
    openFormTemlpate(row) {
      this.codetemplateoid = row.codetemplateoid;
      this.codeClassifyOid = row.codeclsfid;
      this.templateVisible = true;
    },
  },
};
</script>
<style lang="less" scoped></style>
Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -16,48 +16,45 @@
      :key="index"
    >
      <template :slot="item.prop + 'Label'" v-for="item in option.column">
        <span>{{ item.label }} </span>
        <el-tooltip
          v-if="item.keyAttr"
          class="item"
          effect="dark"
          content="该属性为关键属性"
          placement="top-start"
        >
          <i class="el-icon-star-on key_attr_icon"></i>
        </el-tooltip>
        <el-tooltip
          v-if="item.tip"
          class="item"
          effect="dark"
          :content="item.tip"
          placement="top-start"
        >
          <i class="el-icon-warning"></i>
        </el-tooltip>
        <span>
          <span>{{ item.label }} </span>
          <el-tooltip
            v-if="item.keyAttr"
            class="item"
            effect="dark"
            content="该属性为关键属性"
            placement="top-start"
          >
            <i class="el-icon-star-on key_attr_icon"></i>
          </el-tooltip>
          <el-tooltip
            v-if="item.tip"
            class="item"
            effect="dark"
            :content="item.tip"
            placement="top-start"
          >
            <i class="el-icon-warning"></i>
          </el-tooltip>
        </span>
      </template>
    </avue-form>
    <div class="avue-dialog__footer">
    <FindLike ref="findLike" v-if="dialogVisible"></FindLike>
    <div class="avue-dialog__footer" v-if="type !== 'detail'">
      <el-button @click="close()">取 æ¶ˆ</el-button>
      <el-button @click="close()" type="primary">ç¡® å®š</el-button>
      <el-button @click="close()" type="primary" :loading="submitBtnLoading">ç¡® å®š</el-button>
      <el-button @click="findLinkSubmit" type="primary">相似像查询</el-button>
    </div>
    <el-dialog title="测试参照" :visible.sync="visible2" append-to-body>
      <div style="height: 100px;">
        <p>部门数据 {depName: '我是部门名称', depId: '我是部门id'}</p>
      </div>
      <div class="avue-dialog__footer">
        <el-button @click="visible2 = false">取 æ¶ˆ</el-button>
        <el-button @click="czSubmit" type="primary">ç¡® å®š</el-button>
      </div>
    </el-dialog>
  </el-dialog>
</template>
<script>
import { getFormTemplate } from "../../api/common";
import { getFormTemplate, executeCode, findLike } from "@/api/formTemplate";
import { getDictionary } from "../../api/system/dict";
import FindLike from "./FindLike.vue";
export default {
  name: "FormTemplate",
  components: { FindLike },
  props: {
    visible: {
      type: Boolean,
@@ -67,6 +64,18 @@
      type: Array,
      default: () => ["id"],
    },
    templateOid: {
      type: String,
      default: "",
    },
    codeClassifyOid: {
      type: String,
      default: "",
    },
    type: {
      type: String,
      default: 'add'
    }
  },
  data() {
    return {
@@ -90,8 +99,7 @@
        number: "number",
        textarea: "textarea",
        datetime: "datetime",
        date: "date",
        file: "upload",
        date: "date"
      },
      // å‡æ•°æ®
      testItems: [
@@ -537,31 +545,6 @@
          displayExtension: null,
          extendAttrMap: null,
          extendAttrString: null,
          field: "beizhushuoming",
          hidden: false,
          keyAttr: false,
          prefix: "",
          readOnly: false,
          referConfig: null,
          required: false,
          selectLibFlag: "",
          showField: null,
          suffix: "",
          text: "文件功能",
          tooltips: "",
          type: "file",
          unique: false,
          verify: "",
        },
        {
          comboxKey: null,
          customClass: null,
          data: null,
          dateFormate: "",
          defaultValue: "",
          displayExtension: null,
          extendAttrMap: null,
          extendAttrString: null,
          field: "cz",
          hidden: false,
          keyAttr: false,
@@ -579,11 +562,10 @@
          verify: "",
        },
      ],
      visible2: false,
      submitBtnLoading: false
    };
  },
  created() {
  },
  created() {},
  computed: {
    dialogVisible: {
      get() {
@@ -598,10 +580,8 @@
    getFormTemplate() {
      this.loading = true;
      getFormTemplate({
        templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
        codeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
        page: 1,
        limit: 30,
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
      })
        .then((res) => {
          if (res.status === 200) {
@@ -617,8 +597,7 @@
        });
    },
    templateRender() {
      // const items = this.templateData.formDefineVO.items;
      const items = this.testItems;
      const items = this.templateData.formDefineVO.items;
      let column = [];
      let dictKeys = [];
      items.forEach((item) => {
@@ -626,12 +605,15 @@
        if (item.hide) {
          return;
        }
        // æ‰‹æœºå­—å…¸key统一异步请求获取
        if (!this.$utilFunc.isEmpty(item.comboxKey)) {
        if (
          item.type === "combox" &&
          item.comboxKey &&
          (!Array.isArray(item.dicData) || item.dicData.length === 0)
        ) {
          dictKeys.push({ dictKey: item.comboxKey, field: item.field });
        }
        // ç¦ç”¨éƒ¨åˆ†å±žæ€§
        if (this.disabledProp.includes(item.field)) {
        // ç¦ç”¨éƒ¨åˆ†å±žæ€§ï¼ˆå¤–部传值禁用和参照禁用)
        if (this.disabledProp.includes(item.field) || this.$utilFunc.isValuableObj(item.referConfig)) {
          item.readOnly = true;
        }
        // è®¾ç½®è¡¨å•校验的规则,文本
@@ -646,10 +628,10 @@
        let columnItem = {
          label: item.text,
          labelslot: true,
          prop: item.referConfig ? item.showField : item.field,
          prop: this.$utilFunc.isValuableObj(item.referConfig) ? (item.showField || item.field) : item.field,
          type: this.columnType[item.type],
          dicData: this.getDataList(item.type, item.data),
          disabled: item.readOnly,
          disabled: this.type === 'detail' ? true : item.readOnly,
          prepend: this.preOrSufFixShow("text", item.prefix),
          append: this.preOrSufFixShow("text", item.suffix),
          prefixIcon: this.preOrSufFixShow("icon", item.prefix),
@@ -660,18 +642,11 @@
          value: item.defaultValue,
          tip: item.tip,
          comboxKey: item.comboxKey,
          change: ({ value, column }) => {
            this.changeFun(value, column, item.displayExtension);
          change: () => {
            this.changeFun(item.displayExtension, item.prop);
          },
          span: item.type === "file" || item.type === "textarea" ? 24 : null,
          click: this.clickFun(item.referConfig),
          // action:
          //   item.type === "file"
          //     ? "/api/ubcs-resource/oss/endpoint/put-file"
          //     : "",
          // propsHttp: {
          //   res: "data",
          //   url: "link",
          // },
          rules: [
            {
              required: item.required,
@@ -696,27 +671,15 @@
      this.index++;
      this.geDictData(dictKeys);
    },
    changeFun(value, column, jsCode) {
      if (typeof jsCode === "string" && jsCode.length > 0) {
        eval(jsCode);
      }
    changeFun(displayExtension, prop) {
      // executeCode({displayExtension, data: this.form}).then(res => {
      //   this.form[prop] = res.data.data
      // })
    },
    clickFun(referConfig) {
      if (referConfig) {
        return () => {
          this.visible2 = true
        }
      if (this.type === 'detail') {
        return
      }
    },
    czSubmit() {
      this.visible2 = false
      this.form = Object.assign(this.form, {
        depName: "我是部门名称",
        depId: "我是部门id",
      });
    },
    close() {
      this.dialogVisible = false;
    },
    // å‰åŽç¼€
    preOrSufFixShow(type, val) {
@@ -764,11 +727,17 @@
        });
      });
    },
    findLinkSubmit() {
      this.templateData.templateVO.data = this.form
      console.log(this.$refs.findLike, 'this.$refs.findLike');
      this.$refs.findLike.findLinkClick(this.templateData.templateVO)
    }
  },
  watch: {
    visible(newV) {
      if (newV) {
        this.getFormTemplate();
        // this.templateRender()
      }
    },
  },
Source/UBCS-WEB/src/util/func.js
@@ -102,4 +102,12 @@
    }
    return str;
  }
  /**
   * åˆ¤æ–­æ˜¯å¦ä¸ºå¯¹è±¡å¹¶ä¸ä¸ºç©ºå¯¹è±¡
   * @param value
   * @returns {Boolean}
   */
  static isValuableObj(value) {
    return typeof value === 'object' && value !== null && Object.keys(value).length > 0;
  }
}
Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue
@@ -1,9 +1,9 @@
<template>
  <div>
    <el-button @click="visible = true">测试</el-button>
    <FormTemplate :visible.sync="visible"></FormTemplate>
    <FormTemplate :visible.sync="visible" templateOid="78B8C7C5-A042-0B96-FE6D-65421451782A" codeClassifyOid="4524E801-6CC6-92E8-1AC3-2AB9604E8F96"></FormTemplate>
  </div>
</template>
</template>codeClassifyOid
<script>
import FormTemplate from "../../components/FormTemplate/index";