agilebuilder-ui 1.1.1 → 1.1.2-tmp2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +47640 -49415
- package/lib/super-ui.umd.cjs +95 -92
- package/package.json +2 -1
- package/packages/super-grid/src/custom-formatter.js +11 -5
- package/packages/super-grid/src/dynamic-input.vue +115 -2
- package/packages/super-grid/src/super-grid.vue +28 -0
- package/vite.config.js +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agilebuilder-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2-tmp2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./lib/super-ui.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"axios": "^1.5.1",
|
|
29
29
|
"element-plus": "^2.4.1",
|
|
30
30
|
"nprogress": "^0.2.0",
|
|
31
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
31
32
|
"sass": "1.69.4",
|
|
32
33
|
"vite": "^4.4.5",
|
|
33
34
|
"vite-plugin-require-transform": "^1.0.21",
|
|
@@ -239,16 +239,22 @@ const customFormatter = {
|
|
|
239
239
|
jumpPageJson = this.rowLinkConfigMapping[rowIndex]
|
|
240
240
|
}
|
|
241
241
|
if (jumpPageJson && jumpPageJson !== '') {
|
|
242
|
+
// 解析是否需要显示该超链接
|
|
243
|
+
const jumpPageSetting = JSON.parse(jumpPageJson)
|
|
244
|
+
this.jumpPageLink(column, row, listCode, rowIndex, jumpPageSetting)
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
jumpPageLink(column, row, listCode, rowIndex, jumpPageSetting) {
|
|
248
|
+
if (jumpPageSetting) {
|
|
242
249
|
// 解析是否需要显示该超链接
|
|
243
250
|
let canClick = true
|
|
244
251
|
const gridParams = store.get(listCode)
|
|
245
|
-
|
|
246
|
-
console.log('gupre-grid---clickHyperLink--jumpPageSetting=', jumpPageSetting)
|
|
252
|
+
console.log('super-grid---jumpPageLink--jumpPageSetting=', jumpPageSetting)
|
|
247
253
|
if (jumpPageSetting.beforeClick) {
|
|
248
254
|
const funName = jumpPageSetting.beforeClick
|
|
249
|
-
console.log('
|
|
255
|
+
console.log('super-grid---jumpPageLink--jumpPageSetting.beforeClick=', funName)
|
|
250
256
|
console.log(
|
|
251
|
-
'
|
|
257
|
+
'super-grid---jumpPageLink--gridParams.options[eventCallBack]=',
|
|
252
258
|
gridParams.options['eventCallBack']
|
|
253
259
|
)
|
|
254
260
|
if (
|
|
@@ -281,7 +287,7 @@ const customFormatter = {
|
|
|
281
287
|
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
282
288
|
parentFormData = gridParams.options.extraParam.entityMap
|
|
283
289
|
}
|
|
284
|
-
console.log('
|
|
290
|
+
console.log('gridParams.options.extraParam.entityMap', gridParams.options.extraParam)
|
|
285
291
|
|
|
286
292
|
/// 把父页面的pageData传给弹出的页面或新页签
|
|
287
293
|
const copyPageData = JSON.parse(
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
@input="cellEvent('input', $event, true)"
|
|
141
141
|
/>
|
|
142
142
|
<!--必须有@input ,否则无法输入值-->
|
|
143
|
-
<el-input
|
|
143
|
+
<!-- <el-input
|
|
144
144
|
v-else-if="type === 'input'"
|
|
145
145
|
ref="item"
|
|
146
146
|
v-model="innerValue"
|
|
@@ -159,6 +159,85 @@
|
|
|
159
159
|
<template v-if="isShowScanIcon" #append>
|
|
160
160
|
<SuperIcon iconValue="fa-barcode" @click="scanClick()"></SuperIcon>
|
|
161
161
|
</template>
|
|
162
|
+
</el-input> -->
|
|
163
|
+
<el-input
|
|
164
|
+
v-else-if="type === 'input'"
|
|
165
|
+
ref="item"
|
|
166
|
+
:disabled="disabled"
|
|
167
|
+
:maxlength="controlConfig && controlConfig.maxlength ? controlConfig.maxlength : ''"
|
|
168
|
+
:minlength="controlConfig && controlConfig.minlength ? controlConfig.minlength : ''"
|
|
169
|
+
:placeholder="$t('imatrixUIMessage.pleaseEnterContent')"
|
|
170
|
+
:title="innerValue"
|
|
171
|
+
clearable
|
|
172
|
+
v-model="innerValue"
|
|
173
|
+
@blur="cellEvent('blur', $event)"
|
|
174
|
+
@change="cellEvent('change', $event)"
|
|
175
|
+
@clear="cellEvent('clear', $event)"
|
|
176
|
+
@focus="cellEvent('focus', $event)"
|
|
177
|
+
@input="cellEvent('input', $event, true)"
|
|
178
|
+
>
|
|
179
|
+
<template
|
|
180
|
+
v-if="
|
|
181
|
+
designProperty.iconPosition != 'outer' &&
|
|
182
|
+
((designProperty.preIconType && designProperty.preIconValue) || designProperty.preText)
|
|
183
|
+
"
|
|
184
|
+
#prefix
|
|
185
|
+
>
|
|
186
|
+
<SuperIcon
|
|
187
|
+
v-if="designProperty.preIconType && designProperty.preIconValue"
|
|
188
|
+
:iconType="designProperty.preIconType"
|
|
189
|
+
:iconValue="designProperty.preIconValue"
|
|
190
|
+
@click="doClickwithJumpPage('prefixClick')"
|
|
191
|
+
></SuperIcon>
|
|
192
|
+
{{ $t(designProperty.preText) }}
|
|
193
|
+
</template>
|
|
194
|
+
<template
|
|
195
|
+
v-if="
|
|
196
|
+
designProperty.iconPosition == 'outer' &&
|
|
197
|
+
((designProperty.preIconType && designProperty.preIconValue) || designProperty.preText)
|
|
198
|
+
"
|
|
199
|
+
#prepend
|
|
200
|
+
>
|
|
201
|
+
<SuperIcon
|
|
202
|
+
v-if="designProperty.preIconType && designProperty.preIconValue"
|
|
203
|
+
:iconType="designProperty.preIconType"
|
|
204
|
+
:iconValue="designProperty.preIconValue"
|
|
205
|
+
@click="doClickwithJumpPage('prefixClick')"
|
|
206
|
+
></SuperIcon>
|
|
207
|
+
{{ $t(designProperty.preText) }}
|
|
208
|
+
</template>
|
|
209
|
+
<template
|
|
210
|
+
v-if="
|
|
211
|
+
designProperty.iconPosition != 'outer' &&
|
|
212
|
+
((designProperty.sufIconType && designProperty.sufIconValue) || designProperty.sufText)
|
|
213
|
+
"
|
|
214
|
+
#suffix
|
|
215
|
+
>
|
|
216
|
+
<SuperIcon
|
|
217
|
+
v-if="designProperty.sufIconType && designProperty.sufIconValue"
|
|
218
|
+
:iconType="designProperty.sufIconType"
|
|
219
|
+
:iconValue="designProperty.sufIconValue"
|
|
220
|
+
@click="doClickwithJumpPage('suffixClick')"
|
|
221
|
+
></SuperIcon>
|
|
222
|
+
{{ $t(designProperty.sufText) }}
|
|
223
|
+
</template>
|
|
224
|
+
<template
|
|
225
|
+
v-if="
|
|
226
|
+
isShowScanIcon ||
|
|
227
|
+
(designProperty.iconPosition == 'outer' &&
|
|
228
|
+
((designProperty.sufIconType && designProperty.sufIconValue) || designProperty.sufText))
|
|
229
|
+
"
|
|
230
|
+
#append
|
|
231
|
+
>
|
|
232
|
+
<SuperIcon v-if="isShowScanIcon" iconValue="fa-barcode" @click="scanClick()"></SuperIcon>
|
|
233
|
+
<SuperIcon
|
|
234
|
+
v-if="designProperty.sufIconType && designProperty.sufIconValue"
|
|
235
|
+
:iconType="designProperty.sufIconType"
|
|
236
|
+
:iconValue="designProperty.sufIconValue"
|
|
237
|
+
@click="doClickwithJumpPage('suffixClick')"
|
|
238
|
+
></SuperIcon>
|
|
239
|
+
{{ $t(designProperty.sufText) }}
|
|
240
|
+
</template>
|
|
162
241
|
</el-input>
|
|
163
242
|
|
|
164
243
|
<el-input
|
|
@@ -442,6 +521,7 @@ import { $emit } from '../../utils/gogocodeTransfer'
|
|
|
442
521
|
import eventBus from './eventBus'
|
|
443
522
|
import { isMobileBrowser } from '../../../src/utils/common-util'
|
|
444
523
|
import { analysisScanValue, setScanAnalysisValue } from './scan-util.ts'
|
|
524
|
+
import customFormatter from './custom-formatter'
|
|
445
525
|
export default {
|
|
446
526
|
name: 'DynamicInput',
|
|
447
527
|
components: {
|
|
@@ -577,6 +657,9 @@ export default {
|
|
|
577
657
|
if (!baseURL) {
|
|
578
658
|
baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
579
659
|
}
|
|
660
|
+
const colConfigure = gridParams.colConfigureMap ? gridParams.colConfigureMap[this.column.prop] : null
|
|
661
|
+
const runtimeInfo = colConfigure.runtime ? colConfigure.runtime : {}
|
|
662
|
+
const designProperty = runtimeInfo.props ? runtimeInfo.props : {}
|
|
580
663
|
return {
|
|
581
664
|
deptManTree: false, // 是否是部门人员树
|
|
582
665
|
isMultiTree: false, // 是否是多选树
|
|
@@ -638,7 +721,9 @@ export default {
|
|
|
638
721
|
isApk,
|
|
639
722
|
isShowBrowserScan: false,
|
|
640
723
|
isShowScanIcon,
|
|
641
|
-
baseURL
|
|
724
|
+
baseURL,
|
|
725
|
+
colConfigure, // v10字段配置原信息
|
|
726
|
+
designProperty // 字段配置
|
|
642
727
|
}
|
|
643
728
|
},
|
|
644
729
|
computed: {},
|
|
@@ -1847,6 +1932,34 @@ export default {
|
|
|
1847
1932
|
if (columnRule.required !== undefined) {
|
|
1848
1933
|
this.$emit('change-required', columnRule.required)
|
|
1849
1934
|
}
|
|
1935
|
+
},
|
|
1936
|
+
doClickwithJumpPage(eventName) {
|
|
1937
|
+
let configureObj = this.colConfigure
|
|
1938
|
+
let linkPage = configureObj.props.linkPage
|
|
1939
|
+
if (eventName && (eventName === 'click' || eventName === 'prefixClick' || eventName === 'suffixClick' ) && (linkPage && linkPage.jumpPageUrl)) {
|
|
1940
|
+
// 表示有跳转页面配置
|
|
1941
|
+
const jumpJson = JSON.parse(JSON.stringify(item.props.linkPage))
|
|
1942
|
+
if (jumpJson && Array.isArray(jumpJson)) {
|
|
1943
|
+
format.multPage = true
|
|
1944
|
+
jumpJson.forEach((item) => {
|
|
1945
|
+
if (
|
|
1946
|
+
item.jumpPageSetting.displayTextJudge &&
|
|
1947
|
+
item.jumpPageSetting.dynamicTags &&
|
|
1948
|
+
item.jumpPageSetting.dynamicTags.length > 0
|
|
1949
|
+
) {
|
|
1950
|
+
item.jumpPageSetting.displayText = item.jumpPageSetting.dynamicTags.join('-#-#')
|
|
1951
|
+
}
|
|
1952
|
+
})
|
|
1953
|
+
} else {
|
|
1954
|
+
if (jumpJson.displayTextJudge && jumpJson.dynamicTags && jumpJson.dynamicTags.length > 0) {
|
|
1955
|
+
jumpJson.displayText = jumpJson.dynamicTags.join('-#-#')
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
customFormatter.jumpPageLink(this.column, this.row, this.listCode, this.rowIndex, jumpJson)
|
|
1959
|
+
} else {
|
|
1960
|
+
// 表示没有跳转页面配置
|
|
1961
|
+
this.callCustomEvent(eventName)
|
|
1962
|
+
}
|
|
1850
1963
|
}
|
|
1851
1964
|
}
|
|
1852
1965
|
}
|
|
@@ -404,6 +404,7 @@ export default {
|
|
|
404
404
|
if (this.options && this.options.configureObj) {
|
|
405
405
|
configureObj = this.options.configureObj
|
|
406
406
|
}
|
|
407
|
+
|
|
407
408
|
let pageContext
|
|
408
409
|
if (this.options && this.options.pageContext) {
|
|
409
410
|
pageContext = this.options.pageContext
|
|
@@ -1278,6 +1279,8 @@ export default {
|
|
|
1278
1279
|
baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
1279
1280
|
}
|
|
1280
1281
|
this.baseURL = baseURL
|
|
1282
|
+
// 封装v10字段配置
|
|
1283
|
+
gridParams.colConfigureMap = this.packageListColumnSetting()
|
|
1281
1284
|
},
|
|
1282
1285
|
changeRowStyle(param) {
|
|
1283
1286
|
// param的格式:{row, rowIndex}
|
|
@@ -3123,6 +3126,31 @@ export default {
|
|
|
3123
3126
|
params.additionalParamMap = params.additionalParamMap || {}
|
|
3124
3127
|
Object.assign(params.additionalParamMap, additionalParamMap)
|
|
3125
3128
|
}
|
|
3129
|
+
},
|
|
3130
|
+
// 封装v10字段配置,key是数据库字段名(属性名),value是该字段的配置
|
|
3131
|
+
packageListColumnSetting() {
|
|
3132
|
+
// key是属性名,value是字段配置
|
|
3133
|
+
let colConfigureMap = {}
|
|
3134
|
+
if(this.configureObj){
|
|
3135
|
+
const colItems = this.configureObj.items
|
|
3136
|
+
if(colItems) {
|
|
3137
|
+
colItems.forEach((colConfigure)=>{
|
|
3138
|
+
const propName = getFormPropName(colConfigure.props.base.prop)
|
|
3139
|
+
if(propName){
|
|
3140
|
+
colConfigureMap[propName] = colConfigure
|
|
3141
|
+
}
|
|
3142
|
+
})
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
return colConfigureMap
|
|
3146
|
+
},
|
|
3147
|
+
// prop的格式是${data.MY_NAME}
|
|
3148
|
+
getFormPropName(prop) {
|
|
3149
|
+
if (prop && prop.indexOf('${') >= 0) {
|
|
3150
|
+
return prop.substring(prop.indexOf('.') + 1, prop.lastIndexOf('}'))
|
|
3151
|
+
} else {
|
|
3152
|
+
return prop
|
|
3153
|
+
}
|
|
3126
3154
|
}
|
|
3127
3155
|
},
|
|
3128
3156
|
emits: [
|
package/vite.config.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
2
|
import vue from "@vitejs/plugin-vue";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import { terser } from 'rollup-plugin-terser'
|
|
4
5
|
// https://vitejs.dev/config/
|
|
5
6
|
export default defineConfig({
|
|
6
|
-
plugins: [
|
|
7
|
+
plugins: [
|
|
8
|
+
vue(),
|
|
9
|
+
// terser({
|
|
10
|
+
// compress: {
|
|
11
|
+
// drop_console: true,
|
|
12
|
+
// drop_debugger: true
|
|
13
|
+
// }
|
|
14
|
+
// })
|
|
15
|
+
],
|
|
7
16
|
build: {
|
|
8
17
|
outDir: "lib", //输出文件名称
|
|
9
18
|
lib: {
|