Browse Source

Merge branch '1.2.2' into 1.2.4

wu 2 months ago
parent
commit
95abf219d2

File diff suppressed because it is too large
+ 248 - 197
src/components/Generator/components/InputTable/index.vue


+ 2 - 1
src/components/Generator/generator/config.js

@@ -980,7 +980,8 @@ export const selectComponents = [
     relationActionText: '选择数据',
     relationActionText: '选择数据',
     'show-summary': false,
     'show-summary': false,
     tableConf: {},
     tableConf: {},
-    defaultValue: []
+    defaultValue: [],
+    isScan: false
   },
   },
   {
   {
     __config__: {
     __config__: {

+ 96 - 59
src/components/Generator/index/RightComponents/Table.vue

@@ -12,6 +12,9 @@
     <el-form-item v-if="activeData.actionText !== undefined" label="动作文字">
     <el-form-item v-if="activeData.actionText !== undefined" label="动作文字">
       <el-input v-model="activeData.actionText" placeholder="请输入动作文字" />
       <el-input v-model="activeData.actionText" placeholder="请输入动作文字" />
     </el-form-item>
     </el-form-item>
+    <el-form-item v-if="activeData.actionText !== undefined" label="连续扫码">
+      <el-switch v-model="activeData.isScan"></el-switch>
+    </el-form-item>
     <el-form-item label="表数据源" v-if="$store.getters.hasTable">
     <el-form-item label="表数据源" v-if="$store.getters.hasTable">
       <el-select v-model="activeData.__config__.tableName" placeholder="请选择子表数据源" clearable filterable @change="onTableNameChange">
       <el-select v-model="activeData.__config__.tableName" placeholder="请选择子表数据源" clearable filterable @change="onTableNameChange">
         <el-option v-for="item in tableList" :key="item.tableViewName" :label="item.tableComments + ' ' + item.tableViewName" :value="item.tableViewName"> </el-option>
         <el-option v-for="item in tableList" :key="item.tableViewName" :label="item.tableComments + ' ' + item.tableViewName" :value="item.tableViewName"> </el-option>
@@ -36,16 +39,14 @@
       </el-select>
       </el-select>
     </el-form-item>
     </el-form-item>
     <el-tooltip content="" placement="top">
     <el-tooltip content="" placement="top">
-      <div slot="content">注:如表单物理表字段进行了增删改情况,可以通过刷新同步主表结构进行同步更新。<br/>同步新结构后,请调整表单设计,避免不必要的异常情况;</div>
-      <el-button :disabled="!activeData.dbLinkId" @click="fieldCompareChange" type="success" plain style="margin: 10px 0;">
-        刷新同步表结构<i class="el-icon-question" />
-      </el-button>
+      <div slot="content">注:如表单物理表字段进行了增删改情况,可以通过刷新同步主表结构进行同步更新。<br />同步新结构后,请调整表单设计,避免不必要的异常情况;</div>
+      <el-button :disabled="!activeData.dbLinkId" @click="fieldCompareChange" type="success" plain style="margin: 10px 0"> 刷新同步表结构<i class="el-icon-question" /> </el-button>
     </el-tooltip>
     </el-tooltip>
     <el-divider>子表关联录入设置</el-divider>
     <el-divider>子表关联录入设置</el-divider>
     <el-form-item label="子表关联录入" label-width="100px">
     <el-form-item label="子表关联录入" label-width="100px">
       <el-switch v-model="activeData.relationConfFlag" />
       <el-switch v-model="activeData.relationConfFlag" />
     </el-form-item>
     </el-form-item>
-    <el-form-item >
+    <el-form-item>
       <template slot="label">
       <template slot="label">
         <span>选择表单</span>
         <span>选择表单</span>
         <el-tooltip style="cursor: pointer" effect="dark" :content="'被选择的表单需同时符合【未关联其他表单】和【是一个单表表单】才会在下拉选择中展示'" placement="top">
         <el-tooltip style="cursor: pointer" effect="dark" :content="'被选择的表单需同时符合【未关联其他表单】和【是一个单表表单】才会在下拉选择中展示'" placement="top">
@@ -53,32 +54,30 @@
         </el-tooltip>
         </el-tooltip>
       </template>
       </template>
       <el-select v-model="activeData.relationConf.itemRelationTable" filterable placeholder="请选择" clearable @change="onRelationTableChange($event)">
       <el-select v-model="activeData.relationConf.itemRelationTable" filterable placeholder="请选择" clearable @change="onRelationTableChange($event)">
-        <el-option v-for="(item, index) in allTabelList.filter(o=> (o.associationType && o.associationType == 1) && (o.visualdevTableType && o.visualdevTableType == 1))" :label="item.fullName" :value="item.id" :key="item.id"></el-option>
+        <el-option
+          v-for="(item, index) in allTabelList.filter((o) => o.associationType && o.associationType == 1 && o.visualdevTableType && o.visualdevTableType == 1)"
+          :label="item.fullName"
+          :value="item.id"
+          :key="item.id"
+        ></el-option>
       </el-select>
       </el-select>
     </el-form-item>
     </el-form-item>
     <el-form-item label="字段映射关联" label-width="100px">
     <el-form-item label="字段映射关联" label-width="100px">
-      <el-button @click="setRelationColumn" :disabled="renlationColumnsList.length === 0" type="success" plain>
-        设置
-      </el-button>
-      <el-button @click="setFilterColumn" type="success" plain>
-        添加过滤条件
-      </el-button>
+      <el-button @click="setRelationColumn" :disabled="renlationColumnsList.length === 0" type="success" plain> 设置 </el-button>
+      <el-button @click="setFilterColumn" type="success" plain> 添加过滤条件 </el-button>
     </el-form-item>
     </el-form-item>
     <el-form-item v-if="activeData.relationActionText !== undefined" label="批量动作文字" label-width="100px">
     <el-form-item v-if="activeData.relationActionText !== undefined" label="批量动作文字" label-width="100px">
       <el-input v-model="activeData.relationActionText" placeholder="请输入批量动作文字" />
       <el-input v-model="activeData.relationActionText" placeholder="请输入批量动作文字" />
     </el-form-item>
     </el-form-item>
     <el-form-item label="关联字段展示" label-width="100">
     <el-form-item label="关联字段展示" label-width="100">
-      <template v-for="(item,index) in activeData.__config__.children">
+      <template v-for="(item, index) in activeData.__config__.children">
         <el-tag class="showRelationTitle" v-if="getColumnTitle(item.__vModel__)">{{ item.__config__.label }}</el-tag>
         <el-tag class="showRelationTitle" v-if="getColumnTitle(item.__vModel__)">{{ item.__config__.label }}</el-tag>
       </template>
       </template>
     </el-form-item>
     </el-form-item>
-    <el-dialog
-      title="字段映射关联"
-      :visible.sync="dialogVisible"
-      width="600px" append-to-body>
+    <el-dialog title="字段映射关联" :visible.sync="dialogVisible" width="600px" append-to-body>
       <div>
       <div>
         <el-table :data="activeData.relationColumnList" border style="width: 100%">
         <el-table :data="activeData.relationColumnList" border style="width: 100%">
-          <el-table-column :label=" '数据关联表:' + relationPrimaryTableName">
+          <el-table-column :label="'数据关联表:' + relationPrimaryTableName">
             <template slot-scope="scope">
             <template slot-scope="scope">
               <el-select v-model="scope.row.primaryId" filterable placeholder="请选择控件字段" clearable>
               <el-select v-model="scope.row.primaryId" filterable placeholder="请选择控件字段" clearable>
                 <el-option v-for="(item, index) in renlationColumnsList" :label="item.label" :value="item.propId" :key="item.propId"></el-option>
                 <el-option v-for="(item, index) in renlationColumnsList" :label="item.label" :value="item.propId" :key="item.propId"></el-option>
@@ -100,36 +99,62 @@
           </el-table-column>
           </el-table-column>
           <el-table-column width="80">
           <el-table-column width="80">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              <el-button type="text" @click="activeData.relationColumnList.length > 1 ? activeData.relationColumnList.splice(scope.$index,1) : ''"><i style="font-size: 20px;" class="el-icon-delete"></i></el-button>
-              <el-button type="text" @click="activeData.relationColumnList.push({primaryId:'', foreignId:''})"><i style="font-size: 20px;" class="el-icon-circle-plus-outline"></i></el-button>
+              <el-button type="text" @click="activeData.relationColumnList.length > 1 ? activeData.relationColumnList.splice(scope.$index, 1) : ''"
+                ><i style="font-size: 20px" class="el-icon-delete"></i
+              ></el-button>
+              <el-button type="text" @click="activeData.relationColumnList.push({ primaryId: '', foreignId: '' })"><i style="font-size: 20px" class="el-icon-circle-plus-outline"></i></el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
       </div>
       </div>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
-    <el-button @click="dialogVisible = false">取 消</el-button>
-    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
-  </span>
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
     </el-dialog>
     </el-dialog>
     <el-dialog title="字段映射关联" :visible.sync="filterDialogVisible" width="600px" append-to-body>
     <el-dialog title="字段映射关联" :visible.sync="filterDialogVisible" width="600px" append-to-body>
-      <el-button type="success" plain size="mini" @click="activeData.relationConf.filterColumnList.push({columnId:'',viewDataType:'STRING',function:'like',value:''});">+添加筛选条件</el-button>
-      <el-table v-loading="loading" size="mini" :data="activeData.relationConf.filterColumnList"  border  style="width: 100%;margin:10px 0;">
+      <el-button type="success" plain size="mini" @click="activeData.relationConf.filterColumnList.push({ columnId: '', viewDataType: 'STRING', function: 'like', value: '' })"
+        >+添加筛选条件</el-button
+      >
+      <el-table v-loading="loading" size="mini" :data="activeData.relationConf.filterColumnList" border style="width: 100%; margin: 10px 0">
         <el-table-column width="50" align="center">
         <el-table-column width="50" align="center">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <i class="el-icon-delete" style="font-size:20px" @click="activeData.relationConf.filterColumnList.splice(scope.$index,1)"></i>
+            <i class="el-icon-delete" style="font-size: 20px" @click="activeData.relationConf.filterColumnList.splice(scope.$index, 1)"></i>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column label="表单字段" width="180"  align="center">
+        <el-table-column label="表单字段" width="180" align="center">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-select v-model="scope.row.columnId" filterable placeholder="请选择表单字段" clearable @change="scope.row.function = '';scope.row.viewDataType = renlationColumnsList.find(o=>o.propId === scope.row.columnId)?.config?.viewDataType">
+            <el-select
+              v-model="scope.row.columnId"
+              filterable
+              placeholder="请选择表单字段"
+              clearable
+              @change="
+                scope.row.function = ''
+                scope.row.viewDataType = renlationColumnsList.find((o) => o.propId === scope.row.columnId)?.config?.viewDataType
+              "
+            >
               <el-option v-for="(item, index) in renlationColumnsList" :label="item.label" :value="item.propId" :key="item.propId"></el-option>
               <el-option v-for="(item, index) in renlationColumnsList" :label="item.label" :value="item.propId" :key="item.propId"></el-option>
             </el-select>
             </el-select>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column  label="过滤条件" width="130"  align="center">
+        <el-table-column label="过滤条件" width="130" align="center">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-select size="mini" v-model="scope.row.function" placeholder="选择条件" @change="scope.row.function === 'between' ? scope.row.viewDataType === 'NUMBER' ? scope.row.value = ['',''] : scope.row.value = [] : scope.row.function === 'in' ? scope.row.value = [] : scope.row.value = '' ">
-              <el-option v-for="func of globalFunctions[scope.row.viewDataType].filter(o=> o.function !== 'in')" :key="func.function" :value="func.function" :label="func.label"></el-option>
+            <el-select
+              size="mini"
+              v-model="scope.row.function"
+              placeholder="选择条件"
+              @change="
+                scope.row.function === 'between'
+                  ? scope.row.viewDataType === 'NUMBER'
+                    ? (scope.row.value = ['', ''])
+                    : (scope.row.value = [])
+                  : scope.row.function === 'in'
+                    ? (scope.row.value = [])
+                    : (scope.row.value = '')
+              "
+            >
+              <el-option v-for="func of globalFunctions[scope.row.viewDataType].filter((o) => o.function !== 'in')" :key="func.function" :value="func.function" :label="func.label"></el-option>
             </el-select>
             </el-select>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -137,35 +162,35 @@
           <template slot-scope="scope">
           <template slot-scope="scope">
             <template v-if="scope.row.viewDataType === 'STRING' || scope.row.viewDataType === 'NUMBER'">
             <template v-if="scope.row.viewDataType === 'STRING' || scope.row.viewDataType === 'NUMBER'">
               <template v-if="scope.row.function === 'eq' || scope.row.function === 'like' || scope.row.function === ''">
               <template v-if="scope.row.function === 'eq' || scope.row.function === 'like' || scope.row.function === ''">
-                <el-input  v-model="scope.row.value" style="width:130px;margin-left:10px" placeholder="value"></el-input>
+                <el-input v-model="scope.row.value" style="width: 130px; margin-left: 10px" placeholder="value"></el-input>
               </template>
               </template>
-              <template  v-if="scope.row.function === 'between'">
-                <el-input style="width: 100px" size="mini" v-model="scope.row.value[0]"  placeholder="输入值"></el-input>
+              <template v-if="scope.row.function === 'between'">
+                <el-input style="width: 100px" size="mini" v-model="scope.row.value[0]" placeholder="输入值"></el-input>
                 <span>~</span>
                 <span>~</span>
                 <el-input style="width: 100px" size="mini" v-model="scope.row.value[1]" placeholder="输入值"></el-input>
                 <el-input style="width: 100px" size="mini" v-model="scope.row.value[1]" placeholder="输入值"></el-input>
               </template>
               </template>
             </template>
             </template>
             <template v-if="scope.row.viewDataType === 'DATETIME'">
             <template v-if="scope.row.viewDataType === 'DATETIME'">
-              <el-date-picker style="width:220px" v-model="scope.row.value" type="daterange" placeholder="选择日期" clearable value-format="timestamp" ></el-date-picker>
+              <el-date-picker style="width: 220px" v-model="scope.row.value" type="daterange" placeholder="选择日期" clearable value-format="timestamp"></el-date-picker>
             </template>
             </template>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
-    <el-button @click="filterDialogVisible = false">取 消</el-button>
-    <el-button type="primary" @click="filterDialogVisible = false">确 定</el-button>
-  </span>
+        <el-button @click="filterDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="filterDialogVisible = false">确 定</el-button>
+      </span>
     </el-dialog>
     </el-dialog>
   </el-row>
   </el-row>
 </template>
 </template>
 <script>
 <script>
 import comMixin from './mixin'
 import comMixin from './mixin'
 import { createCubeByTable, cubeFieldList, cubeFieldOption } from '@/api/workFlow/FlowEngine'
 import { createCubeByTable, cubeFieldList, cubeFieldOption } from '@/api/workFlow/FlowEngine'
-import {fieldCompare, getConfigData} from "@/api/onlineDev/visualDev";
-import {globalFunctions} from "@/utils/dict";
+import { fieldCompare, getConfigData } from '@/api/onlineDev/visualDev'
+import { globalFunctions } from '@/utils/dict'
 
 
 export default {
 export default {
-  props: ['activeData', 'dbtableList', 'dbSourceId', 'columnModelId','allTabelList'],
+  props: ['activeData', 'dbtableList', 'dbSourceId', 'columnModelId', 'allTabelList'],
   mixins: [comMixin],
   mixins: [comMixin],
   data() {
   data() {
     return {
     return {
@@ -174,7 +199,7 @@ export default {
       dialogVisible: false,
       dialogVisible: false,
       filterDialogVisible: false,
       filterDialogVisible: false,
       renlationColumnsList: [],
       renlationColumnsList: [],
-      relationPrimaryTableName: '',
+      relationPrimaryTableName: ''
     }
     }
   },
   },
   created() {
   created() {
@@ -192,12 +217,24 @@ export default {
   },
   },
   methods: {
   methods: {
     // 刷新同步主表结构
     // 刷新同步主表结构
-    fieldCompareChange(){
-      fieldCompare(this.activeData.dbLinkId).then((res)=>{
-        let data  = res.data.data[0]
-        let creatData = data.fieldsCreat.map((i)=> {return i.columnName}).join(',');
-        let updateData = data.fieldsUpdate.map((i)=> {return i.columnName}).join(',')
-        let deletedData = data.fieldsDeleted.map((i)=> {return i.columnName}).join(',')
+    fieldCompareChange() {
+      fieldCompare(this.activeData.dbLinkId).then((res) => {
+        let data = res.data.data[0]
+        let creatData = data.fieldsCreat
+          .map((i) => {
+            return i.columnName
+          })
+          .join(',')
+        let updateData = data.fieldsUpdate
+          .map((i) => {
+            return i.columnName
+          })
+          .join(',')
+        let deletedData = data.fieldsDeleted
+          .map((i) => {
+            return i.columnName
+          })
+          .join(',')
         // 自定义模板
         // 自定义模板
         const notifyTemplate = `
         const notifyTemplate = `
 <!--            <div>-->
 <!--            <div>-->
@@ -205,14 +242,14 @@ export default {
                 <p style="text-align: initial;"><span>修改字段:</span><span>${updateData || '暂无更新'}</span></p>
                 <p style="text-align: initial;"><span>修改字段:</span><span>${updateData || '暂无更新'}</span></p>
                 <p style="text-align: initial;"><span>删除字段:</span><span>${deletedData || '暂无更新'}</span></p>
                 <p style="text-align: initial;"><span>删除字段:</span><span>${deletedData || '暂无更新'}</span></p>
 <!--            </div>-->
 <!--            </div>-->
-        `;
-        const h = this.$createElement;
+        `
+        const h = this.$createElement
         this.$notify({
         this.$notify({
           title: '提示',
           title: '提示',
           message: notifyTemplate,
           message: notifyTemplate,
           dangerouslyUseHTMLString: true,
           dangerouslyUseHTMLString: true,
           duration: 0
           duration: 0
-        });
+        })
       })
       })
     },
     },
     onTableNameChange(tableName) {
     onTableNameChange(tableName) {
@@ -323,14 +360,14 @@ export default {
     },
     },
     setRelationColumn(v) {
     setRelationColumn(v) {
       this.dialogVisible = true
       this.dialogVisible = true
-      if (!this.activeData.relationColumnList.length){
-        this.activeData.relationColumnList.push({primaryId:'', foreignId:''})
+      if (!this.activeData.relationColumnList.length) {
+        this.activeData.relationColumnList.push({ primaryId: '', foreignId: '' })
       }
       }
     },
     },
-    setFilterColumn(){
+    setFilterColumn() {
       this.filterDialogVisible = true
       this.filterDialogVisible = true
-      if (!this.activeData.relationConf.filterColumnList || !this.activeData.relationConf.filterColumnList.length){
-        this.activeData.relationConf.filterColumnList = [{columnId:'',viewDataType:'STRING',function:'like',value:''}]
+      if (!this.activeData.relationConf.filterColumnList || !this.activeData.relationConf.filterColumnList.length) {
+        this.activeData.relationConf.filterColumnList = [{ columnId: '', viewDataType: 'STRING', function: 'like', value: '' }]
       }
       }
     },
     },
     onRelationTableChange(v) {
     onRelationTableChange(v) {
@@ -344,14 +381,14 @@ export default {
       })
       })
     },
     },
     getColumnTitle(id) {
     getColumnTitle(id) {
-      let data = this.activeData.relationColumnList.find(item => item.foreignId === id )
+      let data = this.activeData.relationColumnList.find((item) => item.foreignId === id)
       return !!data
       return !!data
-    },
+    }
   }
   }
 }
 }
 </script>
 </script>
 <style scoped lang="scss">
 <style scoped lang="scss">
-.showRelationTitle+.showRelationTitle {
+.showRelationTitle + .showRelationTitle {
   margin-left: 10px;
   margin-left: 10px;
 }
 }
 </style>
 </style>

+ 1 - 0
src/views/form/webDesign/customEventExpression.vue

@@ -187,6 +187,7 @@ export default {
       })
       })
     },
     },
     associationListFilter(){
     associationListFilter(){
+      if (!this.associationList || !this.associationList.length) return [];
       let list = this.associationList.reduce((acc, o) => {
       let list = this.associationList.reduce((acc, o) => {
         const existing = acc.find(l => l.tableName === o.tableName);
         const existing = acc.find(l => l.tableName === o.tableName);
         if (!existing) {
         if (!existing) {