Parcourir la source

feat: 添加文本链接配置和前端构建ci集成

johnsen il y a 8 mois
Parent
commit
5155d2120f

+ 14 - 0
src/api/platform/bpmn/bpmTask.js

@@ -118,6 +118,20 @@ export function recoverProcess(params) {
   })
 }
 
+/**
+ * 发起构建接口
+ * @param {*} params
+ */
+export function buildTask(params) {
+  console.log('1111111')
+  return request({
+    url: '/devops/build',
+    method: 'post',
+    isLoading: false,
+    data: params
+  })
+}
+
 /**
  * 保存加签
  * @param  {[type]} data 参数对象

+ 1 - 1
src/business/platform/bpmn/setting/bpmn-setting/types/global.vue

@@ -182,7 +182,7 @@ export default {
     },
     // 其它属性
     attributes() {
-      if (!this.data.attributes) return
+      if (!this.data || !this.data.attributes) return
       // this.data.attributes.subjectRule = this.data.attributes.subjectRule == '{发起人:startorName}在{发起时间:startTime}发起{流程标题:title}' ? '{发起人:startorName} |启动:{流程标题:title}' : this.data.attributes.subjectRule
       return this.data ? this.data.attributes || {} : {}
     }

+ 10 - 0
src/business/platform/form/constants/fieldOptions.js

@@ -32,6 +32,16 @@ export const defauleValueTypeOptions = [
     label: 'javascript脚本'
   }
 ]
+export const textTypeOptions = [
+  {
+    value: 'text',
+    label: '文本'
+  },
+  {
+    value: 'link',
+    label: '链接'
+  }
+]
 export const numberFormatOptions = [
   {
     value: 'orig',

+ 0 - 1
src/business/platform/form/constants/fieldTypes.js

@@ -1251,7 +1251,6 @@ const fieldTypes = {
       // 默认值
       attrs.field_options = {
         default_value_type: 'fixed',
-
         hide_label: false,
         is_label_width: false,
         label_width: 100,

+ 18 - 2
src/business/platform/form/formbuilder/right-aside/editors/editor-base.vue

@@ -145,6 +145,20 @@
           >
         </div>
       </el-form-item>
+      <el-form-item v-if="types.includes('showType')">
+        <template slot="label">显示类型</template>
+        <el-select
+          v-model="fieldItem.field_options.showType"
+          style="width: 100%"
+        >
+          <el-option
+            v-for="item in textTypeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item v-if="types.includes('units')" prop="units">
         <template slot="label">单位<help-tip prop="units" /></template>
         <el-input v-model="fieldOptions.units" />
@@ -274,7 +288,8 @@ import {
   defauleValueTypeOptions,
   datefmtTypeOptions,
   timefmtTypeOptions,
-  numberFormatOptions
+  numberFormatOptions,
+  textTypeOptions
 } from '@/business/platform/form/constants/fieldOptions'
 import IbpsBoSelect from '@/business/platform/bo/def/select'
 import { getDefaultAttributes } from '../../utils'
@@ -314,7 +329,8 @@ export default {
       dynamicScriptVisible: false,
       formulaEditVisible: false,
       linkageDataVisible: false,
-      display: this.fieldItem.field_options.display
+      display: this.fieldItem.field_options.display,
+      textTypeOptions
     }
   },
   computed: {

+ 1 - 1
src/business/platform/form/formbuilder/right-aside/field-types/ibps-field-label.vue

@@ -5,7 +5,7 @@
       <editor-base
         :field-item="fieldItem"
         :bo-data="boData"
-        types="label,defaultValue,placeholder,desc,display"
+        types="label,defaultValue,showType,placeholder,desc,display"
       />
       <!-- 布局设置 -->
       <editor-layout

+ 30 - 21
src/business/platform/form/formrender/dynamic-form/dynamic-form-field.vue

@@ -1,5 +1,9 @@
 <template>
-  <div style="color: #000000" class="jbd-dynamic-form-field">
+  <div
+    :fieldType="fieldType"
+    style="color: #000000"
+    class="jbd-dynamic-form-field"
+  >
     <!-- 单行文本、 多行文本、数字-->
     <template
       v-if="
@@ -23,8 +27,8 @@
             isTable
               ? 'ibps-overflow'
               : dataModel
-                ? 'ibps-field-text'
-                : 'ibps-field-text-no'
+              ? 'ibps-field-text'
+              : 'ibps-field-text-no'
           "
         >
           {{ dataModel || '/' }}
@@ -170,8 +174,8 @@
             isTable
               ? 'ibps-overflow'
               : dataModel
-                ? 'ibps-field-text'
-                : 'ibps-field-text-no'
+              ? 'ibps-field-text'
+              : 'ibps-field-text-no'
           "
         >
           {{ dataModel | optionsFilter(dataOptions, 'label', 'val') }}
@@ -777,7 +781,18 @@
         isTable ? '' : dataModel ? 'ibps-field-text' : 'ibps-field-text-no'
       "
     >
-      <template v-if="value">{{ value || '/' }}</template>
+      <template v-if="value">
+        <template v-if="fieldOptions.showType === 'link'">
+          <el-link
+            v-for="val in arrayValues"
+            type="primary"
+            :key="val"
+            :href="val"
+            >{{ val }}</el-link
+          >
+        </template>
+        <span v-else>{{ value || '/' }}</span>
+      </template>
       <template v-else>{{ placeholder || '/' }}</template>
     </span>
   </div>
@@ -885,6 +900,9 @@ export default {
     }
   },
   computed: {
+    arrayValues() {
+      return this.value ? this.value.split(',') : []
+    },
     fieldType() {
       return this.field.field_type
     },
@@ -1583,31 +1601,22 @@ export default {
 .ibps-field-text {
   white-space: pre-wrap;
   color: #000000;
-  box-shadow:
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 1px 0px 0 rgba(0, 0, 0, 0.1);
+  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.1),
+    0 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0px 0 rgba(0, 0, 0, 0.1);
   padding-left: 5px;
   min-height: 32px;
 }
 .ibps-field-text-img {
   color: #000000;
-  box-shadow:
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 1px 0px 0 rgba(0, 0, 0, 0.1);
+  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.1),
+    0 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0px 0 rgba(0, 0, 0, 0.1);
   padding-left: 5px;
   height: 150px;
 }
 .ibps-field-text-no {
   color: #000000;
-  box-shadow:
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 1px 0px 0 rgba(0, 0, 0, 0.1);
+  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.1),
+    0 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0px 0 rgba(0, 0, 0, 0.1);
   padding-left: 15px;
   min-height: 32px;
   margin-top: 5px;

+ 4 - 1
src/utils/common.js

@@ -6,13 +6,14 @@ import request from '@/business/platform/form/utils/custom/joinCURD'
 import pinyin4js from 'pinyin4js'
 import pinyin from '@/utils/pinyin'
 import { snapshoot } from '@/api/platform/file/attachment'
+import { getToken } from '@/utils/auth'
 import {
   getNextIdByAlias,
   reagentConsumablesInventory
 } from '@/api/platform/system/identity'
 import { save as sendMsg } from '@/api/platform/message/innerMessage'
 import { save as saveNews, manage, internal } from '@/api/platform/system/news'
-import { bpmTaskSave } from '@/api/platform/bpmn/bpmTask'
+import { bpmTaskSave, buildTask } from '@/api/platform/bpmn/bpmTask'
 import { onlyOfficeToPdf } from '@/api/platform/form/seal'
 import { downloadFile as download } from '@/business/platform/file/utils'
 import { removeFormData } from '@/api/platform/data/dataTemplate'
@@ -234,6 +235,7 @@ export default {
   internal,
   manage,
   bpmTaskSave,
+  buildTask,
   getDate,
   getDateNow,
   getFormatDate,
@@ -245,5 +247,6 @@ export default {
   queryRole,
   export2Excel,
   Utils,
+  getToken,
   ActionUtils
 }

+ 2 - 2
src/utils/request.js

@@ -90,8 +90,8 @@ service.interceptors.request.use(
     if (config.gateway) {
       config.baseURL = BASE_GATEWAY_API()
     }
-
-    if (config.url?.includes('/jyxt/SampleProcess') && process.env.NODE_ENV === 'development') {
+    const urls = ['/jyxt/SampleProcess', '/devops/build']
+    if (urls.some(t => config.url?.includes(t)) && process.env.NODE_ENV === 'development') {
       config.baseURL = ''
     }
 

+ 5 - 1
vue.config.js

@@ -66,7 +66,7 @@ module.exports = {
       // 设置 scss 公用变量文件
       sass: {
         /* sass-loader 9.0+写法*/
-        additionalData (content, loaderContext) {
+        additionalData(content, loaderContext) {
           const { resourcePath, rootContext } = loaderContext
           const relativePath = path.relative(rootContext, resourcePath)
           if (
@@ -244,6 +244,10 @@ module.exports = {
       '/jyxt': { // 请求相对路径以 /user 开头的,才会走这里的配置
         target: 'http://192.168.2.107:8090', // 这个就是后端地址
         changeOrigin: true
+      },
+      '/devops': { // 请求相对路径以 /user 开头的,才会走这里的配置
+        target: 'http://192.168.2.181:3000', // 这个就是后端地址
+        changeOrigin: true
       }
     }
   },