ecinc-cloud-wappaio 9.7.55 → 9.7.56
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/index.js +1 -0
- package/lib/ecwappaio.common.js +618 -0
- package/lib/ecwappaio.umd.js +618 -0
- package/lib/ecwappaio.umd.min.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -102,6 +102,7 @@ const asyncComponents = [
|
|
|
102
102
|
['ColumnEdit', () => import(/* webpackChunkName: "plat-organ" */ '../../ecwplat/Organ/index').then((m) => m.ColumnEdit)],
|
|
103
103
|
['WfdList', () => import(/* webpackChunkName: "plat-wfdefine" */ '../../ecwplat/WfDefine').then((m) => m.WfdList)],
|
|
104
104
|
['EditorConfig', () => import(/* webpackChunkName: "plat-editor" */ '../../ecwplat/EditorConfig').then((m) => m.EditorConfig)],
|
|
105
|
+
['DataDictForm', () => import(/* webpackChunkName: "plat-editor" */ '../../ecwplat/DataDict').then((m) => m.DataDictForm)],
|
|
105
106
|
|
|
106
107
|
// ========== ecwplus 设计器系列 → chunk: devtool-* ==========
|
|
107
108
|
['BusiformDesigner', () => import(/* webpackChunkName: "devtool-busiform" */ '../../ecwplus/BusiformDesigner').then((m) => m.BusiformDesigner)],
|
package/lib/ecwappaio.common.js
CHANGED
|
@@ -53844,6 +53844,583 @@ var install = function install(Vue) {
|
|
|
53844
53844
|
|
|
53845
53845
|
/***/ }),
|
|
53846
53846
|
|
|
53847
|
+
/***/ 34719:
|
|
53848
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
53849
|
+
|
|
53850
|
+
"use strict";
|
|
53851
|
+
// ESM COMPAT FLAG
|
|
53852
|
+
__webpack_require__.r(__webpack_exports__);
|
|
53853
|
+
|
|
53854
|
+
// EXPORTS
|
|
53855
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
53856
|
+
DataDictForm: function() { return /* binding */ DataDictForm; }
|
|
53857
|
+
});
|
|
53858
|
+
|
|
53859
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwplat/DataDict/src/form.vue?vue&type=template&id=75222ba9
|
|
53860
|
+
var render = function render() {
|
|
53861
|
+
var _vm = this,
|
|
53862
|
+
_c = _vm._self._c;
|
|
53863
|
+
return _c('div', {
|
|
53864
|
+
attrs: {
|
|
53865
|
+
"id": "dcontent_data-dict"
|
|
53866
|
+
}
|
|
53867
|
+
}, [_c('el-form', {
|
|
53868
|
+
attrs: {
|
|
53869
|
+
"model": _vm.vo
|
|
53870
|
+
},
|
|
53871
|
+
nativeOn: {
|
|
53872
|
+
"submit": function submit($event) {
|
|
53873
|
+
$event.preventDefault();
|
|
53874
|
+
}
|
|
53875
|
+
}
|
|
53876
|
+
}, [_c('div', {
|
|
53877
|
+
staticClass: "el-table el-table--fit el-table--border",
|
|
53878
|
+
staticStyle: {
|
|
53879
|
+
"width": "100%"
|
|
53880
|
+
}
|
|
53881
|
+
}, [_c('div', {
|
|
53882
|
+
staticClass: "el-table__body-wrapper"
|
|
53883
|
+
}, [_c('table', {
|
|
53884
|
+
staticClass: "el-table__body",
|
|
53885
|
+
attrs: {
|
|
53886
|
+
"cellspacing": "0",
|
|
53887
|
+
"cellpadding": "0",
|
|
53888
|
+
"border": "0"
|
|
53889
|
+
}
|
|
53890
|
+
}, [_c('tbody', [ false ? 0 : _vm._e(), false ? 0 : _vm._e(), _c('tr', [_c('td', {
|
|
53891
|
+
ref: "tdlbl_字典说明",
|
|
53892
|
+
staticClass: "el-table__cell tdlbl tdw17",
|
|
53893
|
+
attrs: {
|
|
53894
|
+
"colspan": "1"
|
|
53895
|
+
}
|
|
53896
|
+
}, [_c('span', {
|
|
53897
|
+
staticClass: "required"
|
|
53898
|
+
}, [_vm._v("*")]), _c('span', {
|
|
53899
|
+
directives: [{
|
|
53900
|
+
name: "field-lbl",
|
|
53901
|
+
rawName: "v-field-lbl",
|
|
53902
|
+
value: 'paramDesc',
|
|
53903
|
+
expression: "'paramDesc'"
|
|
53904
|
+
}],
|
|
53905
|
+
staticClass: "field"
|
|
53906
|
+
}, [_vm._v("字典说明")])]), _c('td', {
|
|
53907
|
+
staticClass: "el-table__cell tdcont tdw83",
|
|
53908
|
+
attrs: {
|
|
53909
|
+
"colspan": "5"
|
|
53910
|
+
}
|
|
53911
|
+
}, [_c('form-item', {
|
|
53912
|
+
ref: 'field-paramDesc',
|
|
53913
|
+
attrs: {
|
|
53914
|
+
"field": {
|
|
53915
|
+
'textFormatter': 'textfield',
|
|
53916
|
+
'elementType': 'input',
|
|
53917
|
+
'propName': 'paramDesc',
|
|
53918
|
+
'model': 'vo.paramDesc',
|
|
53919
|
+
'emptyMessage': '请输入字典说明',
|
|
53920
|
+
'isRequired': 1,
|
|
53921
|
+
'elementCanEdit': '{${canEdit}}',
|
|
53922
|
+
'elementReadonly': 0,
|
|
53923
|
+
'valueMaxLength': '500',
|
|
53924
|
+
'propComment': '字典说明'
|
|
53925
|
+
},
|
|
53926
|
+
"vo": _vm.vo,
|
|
53927
|
+
"can-edit": _vm.canEdit
|
|
53928
|
+
}
|
|
53929
|
+
})], 1)]), _c('tr', [_c('td', {
|
|
53930
|
+
ref: "tdlbl_字典编码",
|
|
53931
|
+
staticClass: "el-table__cell tdlbl tdw17",
|
|
53932
|
+
attrs: {
|
|
53933
|
+
"colspan": "1"
|
|
53934
|
+
}
|
|
53935
|
+
}, [_c('span', {
|
|
53936
|
+
staticClass: "required"
|
|
53937
|
+
}, [_vm._v("*")]), _c('span', {
|
|
53938
|
+
directives: [{
|
|
53939
|
+
name: "field-lbl",
|
|
53940
|
+
rawName: "v-field-lbl",
|
|
53941
|
+
value: 'paramName',
|
|
53942
|
+
expression: "'paramName'"
|
|
53943
|
+
}],
|
|
53944
|
+
staticClass: "field"
|
|
53945
|
+
}, [_vm._v("字典编码")])]), _c('td', {
|
|
53946
|
+
staticClass: "el-table__cell tdcont tdw83",
|
|
53947
|
+
attrs: {
|
|
53948
|
+
"colspan": "5"
|
|
53949
|
+
}
|
|
53950
|
+
}, [_c('form-item', {
|
|
53951
|
+
ref: 'field-paramName',
|
|
53952
|
+
attrs: {
|
|
53953
|
+
"field": {
|
|
53954
|
+
'textFormatter': 'textfield',
|
|
53955
|
+
'elementType': 'input',
|
|
53956
|
+
'propName': 'paramName',
|
|
53957
|
+
'model': 'vo.paramNameInput',
|
|
53958
|
+
'emptyMessage': '请输入字典编码',
|
|
53959
|
+
'isRequired': 1,
|
|
53960
|
+
'elementCanEdit': '{${canEdit}}',
|
|
53961
|
+
'elementReadonly': 0,
|
|
53962
|
+
'valueMaxLength': '500',
|
|
53963
|
+
'propComment': '字典编码'
|
|
53964
|
+
},
|
|
53965
|
+
"vo": _vm.vo,
|
|
53966
|
+
"can-edit": _vm.canEdit
|
|
53967
|
+
}
|
|
53968
|
+
})], 1)]), false ? 0 : _vm._e(), _c('tr', [_c('td', {
|
|
53969
|
+
ref: "tdlbl_列表选项配置",
|
|
53970
|
+
staticClass: "el-table__cell tdlbl tdw17",
|
|
53971
|
+
staticStyle: {
|
|
53972
|
+
"text-align": "right"
|
|
53973
|
+
}
|
|
53974
|
+
}, [_vm._v(" 列表选项配置")]), _c('td', {
|
|
53975
|
+
staticClass: "el-table__cell tdcont tdw83",
|
|
53976
|
+
staticStyle: {
|
|
53977
|
+
"padding": "0 !important"
|
|
53978
|
+
},
|
|
53979
|
+
attrs: {
|
|
53980
|
+
"colspan": "5"
|
|
53981
|
+
}
|
|
53982
|
+
}, [_c('table', {
|
|
53983
|
+
staticClass: "lyy-table option-config-table",
|
|
53984
|
+
staticStyle: {
|
|
53985
|
+
"width": "100%",
|
|
53986
|
+
"border-collapse": "collapse"
|
|
53987
|
+
},
|
|
53988
|
+
attrs: {
|
|
53989
|
+
"border": "0"
|
|
53990
|
+
}
|
|
53991
|
+
}, [_c('thead', [_c('tr', {
|
|
53992
|
+
staticClass: "option-header"
|
|
53993
|
+
}, [_c('td', {
|
|
53994
|
+
staticClass: "el-table__cell tdlbl",
|
|
53995
|
+
staticStyle: {
|
|
53996
|
+
"text-align": "center",
|
|
53997
|
+
"width": "41%",
|
|
53998
|
+
"color": "black",
|
|
53999
|
+
"font-weight": "600",
|
|
54000
|
+
"background-color": "#f5f7fa"
|
|
54001
|
+
}
|
|
54002
|
+
}, [_vm._v(" 选项值")]), _c('td', {
|
|
54003
|
+
staticClass: "el-table__cell tdlbl",
|
|
54004
|
+
staticStyle: {
|
|
54005
|
+
"text-align": "center",
|
|
54006
|
+
"width": "41%",
|
|
54007
|
+
"color": "black",
|
|
54008
|
+
"font-weight": "600",
|
|
54009
|
+
"background-color": "#f5f7fa"
|
|
54010
|
+
}
|
|
54011
|
+
}, [_vm._v(" 显示文本")]), _c('td', {
|
|
54012
|
+
staticClass: "el-table__cell tdlbl",
|
|
54013
|
+
staticStyle: {
|
|
54014
|
+
"text-align": "center",
|
|
54015
|
+
"width": "18%",
|
|
54016
|
+
"color": "black",
|
|
54017
|
+
"font-weight": "600",
|
|
54018
|
+
"border-right": "none",
|
|
54019
|
+
"background-color": "#f5f7fa"
|
|
54020
|
+
}
|
|
54021
|
+
}, [_vm._v(" 操作")])])]), _c('tbody', {
|
|
54022
|
+
ref: "optionTbody"
|
|
54023
|
+
}, _vm._l(_vm.optionList, function (opt, idx) {
|
|
54024
|
+
return _c('tr', {
|
|
54025
|
+
key: opt._dragKey
|
|
54026
|
+
}, [_c('td', {
|
|
54027
|
+
staticStyle: {
|
|
54028
|
+
"text-align": "center",
|
|
54029
|
+
"padding": "4px 8px"
|
|
54030
|
+
}
|
|
54031
|
+
}, [_c('el-input', {
|
|
54032
|
+
attrs: {
|
|
54033
|
+
"placeholder": "选项值",
|
|
54034
|
+
"disabled": !_vm.canEdit
|
|
54035
|
+
},
|
|
54036
|
+
on: {
|
|
54037
|
+
"input": _vm.syncOptionsToParamValue
|
|
54038
|
+
},
|
|
54039
|
+
model: {
|
|
54040
|
+
value: opt.value,
|
|
54041
|
+
callback: function callback($$v) {
|
|
54042
|
+
_vm.$set(opt, "value", $$v);
|
|
54043
|
+
},
|
|
54044
|
+
expression: "opt.value"
|
|
54045
|
+
}
|
|
54046
|
+
})], 1), _c('td', {
|
|
54047
|
+
staticStyle: {
|
|
54048
|
+
"text-align": "center",
|
|
54049
|
+
"padding": "4px 8px"
|
|
54050
|
+
}
|
|
54051
|
+
}, [_c('el-input', {
|
|
54052
|
+
attrs: {
|
|
54053
|
+
"placeholder": "显示文本",
|
|
54054
|
+
"disabled": !_vm.canEdit
|
|
54055
|
+
},
|
|
54056
|
+
on: {
|
|
54057
|
+
"input": _vm.syncOptionsToParamValue
|
|
54058
|
+
},
|
|
54059
|
+
model: {
|
|
54060
|
+
value: opt.text,
|
|
54061
|
+
callback: function callback($$v) {
|
|
54062
|
+
_vm.$set(opt, "text", $$v);
|
|
54063
|
+
},
|
|
54064
|
+
expression: "opt.text"
|
|
54065
|
+
}
|
|
54066
|
+
})], 1), _c('td', {
|
|
54067
|
+
staticStyle: {
|
|
54068
|
+
"text-align": "center",
|
|
54069
|
+
"padding": "4px 8px",
|
|
54070
|
+
"white-space": "nowrap"
|
|
54071
|
+
}
|
|
54072
|
+
}, [_vm.canEdit ? _c('i', {
|
|
54073
|
+
staticClass: "option-drag-handle el-icon-rank",
|
|
54074
|
+
staticStyle: {
|
|
54075
|
+
"cursor": "move",
|
|
54076
|
+
"color": "#909399",
|
|
54077
|
+
"margin-right": "8px",
|
|
54078
|
+
"font-size": "16px",
|
|
54079
|
+
"vertical-align": "middle"
|
|
54080
|
+
},
|
|
54081
|
+
attrs: {
|
|
54082
|
+
"title": "拖拽排序"
|
|
54083
|
+
}
|
|
54084
|
+
}) : _vm._e(), _c('el-button', {
|
|
54085
|
+
attrs: {
|
|
54086
|
+
"type": "danger",
|
|
54087
|
+
"plain": "",
|
|
54088
|
+
"size": "small",
|
|
54089
|
+
"icon": "el-icon-delete",
|
|
54090
|
+
"disabled": !_vm.canEdit
|
|
54091
|
+
},
|
|
54092
|
+
on: {
|
|
54093
|
+
"click": function click($event) {
|
|
54094
|
+
return _vm.removeOption(idx);
|
|
54095
|
+
}
|
|
54096
|
+
}
|
|
54097
|
+
}, [_vm._v("删除")])], 1)]);
|
|
54098
|
+
}), 0)]), _c('div', {
|
|
54099
|
+
staticStyle: {
|
|
54100
|
+
"padding": "8px"
|
|
54101
|
+
}
|
|
54102
|
+
}, [_c('el-button', {
|
|
54103
|
+
attrs: {
|
|
54104
|
+
"type": "primary",
|
|
54105
|
+
"plain": "",
|
|
54106
|
+
"size": "small",
|
|
54107
|
+
"icon": "el-icon-plus",
|
|
54108
|
+
"disabled": !_vm.canEdit
|
|
54109
|
+
},
|
|
54110
|
+
on: {
|
|
54111
|
+
"click": _vm.addOption
|
|
54112
|
+
}
|
|
54113
|
+
}, [_vm._v("添加选项")])], 1)])]), false ? 0 : _vm._e()])])])])])], 1);
|
|
54114
|
+
};
|
|
54115
|
+
var staticRenderFns = [];
|
|
54116
|
+
|
|
54117
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwplat/DataDict/src/form.vue?vue&type=script&lang=js
|
|
54118
|
+
/* harmony default export */ var formvue_type_script_lang_js = ({
|
|
54119
|
+
name: 'DataDictForm',
|
|
54120
|
+
props: {
|
|
54121
|
+
vo: {
|
|
54122
|
+
type: Object,
|
|
54123
|
+
default: function _default() {
|
|
54124
|
+
return {};
|
|
54125
|
+
}
|
|
54126
|
+
},
|
|
54127
|
+
canEdit: {
|
|
54128
|
+
type: Number,
|
|
54129
|
+
default: 1
|
|
54130
|
+
},
|
|
54131
|
+
moduleInfo: {
|
|
54132
|
+
type: Object,
|
|
54133
|
+
default: function _default() {
|
|
54134
|
+
return {};
|
|
54135
|
+
}
|
|
54136
|
+
}
|
|
54137
|
+
},
|
|
54138
|
+
data: function data() {
|
|
54139
|
+
return {
|
|
54140
|
+
loginUser: this.$store.getters.loginUser,
|
|
54141
|
+
// 每行带稳定 _dragKey,供 v-for :key 与 Sortable 配合
|
|
54142
|
+
optionList: [{
|
|
54143
|
+
value: '',
|
|
54144
|
+
text: '',
|
|
54145
|
+
_dragKey: 'opt_init_0'
|
|
54146
|
+
}],
|
|
54147
|
+
syncing: false,
|
|
54148
|
+
// Sortable 实例,销毁时释放
|
|
54149
|
+
sortableInst: null,
|
|
54150
|
+
// 生成唯一拖拽 key 的序号
|
|
54151
|
+
dragKeySeq: 1,
|
|
54152
|
+
// 字典编码前缀(来自路由 meta.params 的 paramType=xxx),用于 paramName 前缀拼接
|
|
54153
|
+
paramPrefix: ''
|
|
54154
|
+
};
|
|
54155
|
+
},
|
|
54156
|
+
created: function created() {
|
|
54157
|
+
if (this.$parent.$vnode.context.activeTabIndex) {
|
|
54158
|
+
this.activeTabName = this.$parent.$vnode.context.activeTabIndex;
|
|
54159
|
+
}
|
|
54160
|
+
this.$set(this.$vnode.context, "wfAttach", false);
|
|
54161
|
+
// 提取路由 meta.params 中 paramType= 后面的前缀(如 rsgl.options),供 paramName 前缀拼接使用
|
|
54162
|
+
this.paramPrefix = this.extractParamPrefix();
|
|
54163
|
+
},
|
|
54164
|
+
mounted: function mounted() {
|
|
54165
|
+
// 表单框架钩子未触发,这里直接设置 sysCode/sysName/paramType(新增时默认值)
|
|
54166
|
+
if (this.vo) {
|
|
54167
|
+
if (!this.vo.sysCode) this.vo.sysCode = this.loginUser.sysCode;
|
|
54168
|
+
if (!this.vo.sysName) this.vo.sysName = this.loginUser.sysName;
|
|
54169
|
+
if (!this.vo.paramType && this.$route && this.$route.query && this.$route.query.paramType) {
|
|
54170
|
+
this.vo.paramType = this.$route.query.paramType;
|
|
54171
|
+
}
|
|
54172
|
+
// 初始化字典编码输入值(去前缀显示):用户编辑 paramNameInput,watch 自动同步带前缀到 vo.paramName
|
|
54173
|
+
var pn = this.vo.paramName || '';
|
|
54174
|
+
if (this.paramPrefix && pn.indexOf(this.paramPrefix + '.') === 0) {
|
|
54175
|
+
pn = pn.substring(this.paramPrefix.length + 1);
|
|
54176
|
+
}
|
|
54177
|
+
this.$set(this.vo, 'paramNameInput', pn);
|
|
54178
|
+
// 立即同步一次,确保 vo.paramName 带前缀
|
|
54179
|
+
this.syncParamName(pn);
|
|
54180
|
+
}
|
|
54181
|
+
// 解析选项配置到选项列表(兜底,防止 watch immediate 时序遗漏)
|
|
54182
|
+
this.parseParamValueToOptions();
|
|
54183
|
+
// 等 DOM 按最新 optionList 渲染完成后再挂载 Sortable
|
|
54184
|
+
var self = this;
|
|
54185
|
+
this.$nextTick(function () {
|
|
54186
|
+
self.initSortable();
|
|
54187
|
+
});
|
|
54188
|
+
},
|
|
54189
|
+
beforeDestroy: function beforeDestroy() {
|
|
54190
|
+
// 组件销毁时释放 Sortable,避免残留事件监听
|
|
54191
|
+
this.destroySortable();
|
|
54192
|
+
},
|
|
54193
|
+
watch: {
|
|
54194
|
+
// 用户编辑字典编码输入值,实时同步带前缀到 vo.paramName(框架提交读 vo.paramName)
|
|
54195
|
+
'vo.paramNameInput': function voParamNameInput(val) {
|
|
54196
|
+
this.syncParamName(val);
|
|
54197
|
+
},
|
|
54198
|
+
'vo.paramValue': {
|
|
54199
|
+
handler: function handler() {
|
|
54200
|
+
// syncing 标志位:选项配置器触发的 paramValue 变化不再反向解析,避免死循环
|
|
54201
|
+
if (this.syncing) return;
|
|
54202
|
+
this.parseParamValueToOptions();
|
|
54203
|
+
},
|
|
54204
|
+
immediate: true
|
|
54205
|
+
},
|
|
54206
|
+
// canEdit 变化时同步 Sortable 的 disabled 状态(平台权限数字型)
|
|
54207
|
+
canEdit: function canEdit(val) {
|
|
54208
|
+
if (this.sortableInst) {
|
|
54209
|
+
this.sortableInst.option('disabled', !val);
|
|
54210
|
+
}
|
|
54211
|
+
}
|
|
54212
|
+
},
|
|
54213
|
+
methods: {
|
|
54214
|
+
/**
|
|
54215
|
+
* 从路由 meta.params 提取 paramType= 后面的前缀
|
|
54216
|
+
* 例如 meta.params="paramType=rsgl.options" 返回 "rsgl.options"
|
|
54217
|
+
* @returns {string} 前缀,无则返回空字符串
|
|
54218
|
+
*/
|
|
54219
|
+
extractParamPrefix: function extractParamPrefix() {
|
|
54220
|
+
var metaParams = this.$route && this.$route.meta && this.$route.meta.params;
|
|
54221
|
+
if (!metaParams || typeof metaParams !== 'string') return '';
|
|
54222
|
+
var key = 'paramType=';
|
|
54223
|
+
var idx = metaParams.indexOf(key);
|
|
54224
|
+
if (idx === -1) return '';
|
|
54225
|
+
var after = metaParams.substring(idx + key.length);
|
|
54226
|
+
var sep = after.indexOf(';');
|
|
54227
|
+
var prefix = (sep === -1 ? after : after.substring(0, sep)).trim();
|
|
54228
|
+
return prefix || '';
|
|
54229
|
+
},
|
|
54230
|
+
/**
|
|
54231
|
+
* 同步字典编码:将用户输入值按前缀规则拼接到 vo.paramName
|
|
54232
|
+
* 规则:inputVal 已以 prefix 开头则保持;否则 vo.paramName = prefix + "." + inputVal
|
|
54233
|
+
* 框架提交时读取 vo.paramName,即为带前缀的值
|
|
54234
|
+
* @param {string} inputVal 用户编辑的编码输入值(不带前缀)
|
|
54235
|
+
*/
|
|
54236
|
+
syncParamName: function syncParamName(inputVal) {
|
|
54237
|
+
if (!this.vo) return;
|
|
54238
|
+
var prefix = this.paramPrefix;
|
|
54239
|
+
inputVal = inputVal || '';
|
|
54240
|
+
if (!prefix || !inputVal) {
|
|
54241
|
+
this.vo.paramName = inputVal;
|
|
54242
|
+
return;
|
|
54243
|
+
}
|
|
54244
|
+
if (inputVal.indexOf(prefix) === 0) {
|
|
54245
|
+
this.vo.paramName = inputVal;
|
|
54246
|
+
} else {
|
|
54247
|
+
this.vo.paramName = prefix + '.' + inputVal;
|
|
54248
|
+
}
|
|
54249
|
+
},
|
|
54250
|
+
/**
|
|
54251
|
+
* 生成选项行稳定唯一 key
|
|
54252
|
+
* @returns {string} 拖拽用 key
|
|
54253
|
+
*/
|
|
54254
|
+
nextDragKey: function nextDragKey() {
|
|
54255
|
+
this.dragKeySeq += 1;
|
|
54256
|
+
return 'opt_' + this.dragKeySeq + '_' + Date.now();
|
|
54257
|
+
},
|
|
54258
|
+
/**
|
|
54259
|
+
* 销毁已有 Sortable 实例
|
|
54260
|
+
*/
|
|
54261
|
+
destroySortable: function destroySortable() {
|
|
54262
|
+
if (this.sortableInst) {
|
|
54263
|
+
try {
|
|
54264
|
+
this.sortableInst.destroy();
|
|
54265
|
+
} catch (e) {
|
|
54266
|
+
// 忽略销毁异常
|
|
54267
|
+
}
|
|
54268
|
+
this.sortableInst = null;
|
|
54269
|
+
}
|
|
54270
|
+
},
|
|
54271
|
+
/**
|
|
54272
|
+
* 初始化拖拽排序
|
|
54273
|
+
* 使用 window.Sortable(vue.config.js 已 external 为全局,public 已引入 Sortable.min.js)
|
|
54274
|
+
* onEnd 里同步 optionList,保证 Vue 数据与 DOM 顺序一致
|
|
54275
|
+
*/
|
|
54276
|
+
initSortable: function initSortable() {
|
|
54277
|
+
var self = this;
|
|
54278
|
+
var el = this.$refs.optionTbody;
|
|
54279
|
+
if (!el) return;
|
|
54280
|
+
|
|
54281
|
+
// 与项目其他页面一致:使用全局 Sortable,不走 require(externals 下 require 易静默失败)
|
|
54282
|
+
var SortableLib = typeof window !== 'undefined' && window.Sortable || (typeof Sortable !== 'undefined' ? Sortable : null);
|
|
54283
|
+
if (!SortableLib || typeof SortableLib.create !== 'function') {
|
|
54284
|
+
console.warn('[dictionary/form] Sortable 未加载,拖拽排序不可用');
|
|
54285
|
+
return;
|
|
54286
|
+
}
|
|
54287
|
+
|
|
54288
|
+
// 重复初始化时先销毁旧实例
|
|
54289
|
+
this.destroySortable();
|
|
54290
|
+
this.sortableInst = SortableLib.create(el, {
|
|
54291
|
+
handle: '.option-drag-handle',
|
|
54292
|
+
animation: 150,
|
|
54293
|
+
// 嵌套表格/滚动容器下原生 DnD 可能失效,强制 fallback 更稳
|
|
54294
|
+
forceFallback: true,
|
|
54295
|
+
// canEdit 为数字型权限,0 禁用,非 0 可拖
|
|
54296
|
+
disabled: !this.canEdit,
|
|
54297
|
+
onEnd: function onEnd(evt) {
|
|
54298
|
+
if (evt.oldIndex === evt.newIndex) return;
|
|
54299
|
+
// Sortable 已移动 DOM,同步到数据数组,Vue 按 _dragKey 复用节点
|
|
54300
|
+
var moved = self.optionList.splice(evt.oldIndex, 1)[0];
|
|
54301
|
+
self.optionList.splice(evt.newIndex, 0, moved);
|
|
54302
|
+
self.syncOptionsToParamValue();
|
|
54303
|
+
}
|
|
54304
|
+
});
|
|
54305
|
+
},
|
|
54306
|
+
// 解析 vo.paramValue 为 optionList;为空/解析失败/空数组时默认一条空选项
|
|
54307
|
+
parseParamValueToOptions: function parseParamValueToOptions() {
|
|
54308
|
+
var val = this.vo.paramValue;
|
|
54309
|
+
var list = [];
|
|
54310
|
+
var self = this;
|
|
54311
|
+
if (val && typeof val === 'string' && val.trim().charAt(0) === '[') {
|
|
54312
|
+
try {
|
|
54313
|
+
// 兼容单引号JS对象字面量(如 [{ value: 'A型', text: 'A型' }])与标准JSON双引号格式
|
|
54314
|
+
var parsed = new Function('return ' + val)();
|
|
54315
|
+
if (parsed && Array.isArray(parsed)) {
|
|
54316
|
+
list = parsed.map(function (item) {
|
|
54317
|
+
return {
|
|
54318
|
+
value: item && item.value != null ? String(item.value) : '',
|
|
54319
|
+
text: item && item.text != null ? String(item.text) : '',
|
|
54320
|
+
// 解析时补上稳定 key,避免 v-for 用 index 导致拖拽回弹
|
|
54321
|
+
_dragKey: self.nextDragKey()
|
|
54322
|
+
};
|
|
54323
|
+
});
|
|
54324
|
+
}
|
|
54325
|
+
} catch (e) {
|
|
54326
|
+
// 解析失败(用户手动编辑未完成或格式错误),保留原状不覆盖 optionList
|
|
54327
|
+
}
|
|
54328
|
+
}
|
|
54329
|
+
if (list.length === 0) {
|
|
54330
|
+
list = [{
|
|
54331
|
+
value: '',
|
|
54332
|
+
text: '',
|
|
54333
|
+
_dragKey: this.nextDragKey()
|
|
54334
|
+
}];
|
|
54335
|
+
}
|
|
54336
|
+
this.optionList = list;
|
|
54337
|
+
},
|
|
54338
|
+
// 将 optionList 序列化为 JSON 字符串写入 vo.paramValue(过滤 value 与 text 均为空的行)
|
|
54339
|
+
syncOptionsToParamValue: function syncOptionsToParamValue() {
|
|
54340
|
+
this.syncing = true;
|
|
54341
|
+
// 序列化时去掉内部 _dragKey,不落库
|
|
54342
|
+
var filtered = this.optionList.filter(function (opt) {
|
|
54343
|
+
var v = opt.value != null ? String(opt.value).trim() : '';
|
|
54344
|
+
var t = opt.text != null ? String(opt.text).trim() : '';
|
|
54345
|
+
return v !== '' || t !== '';
|
|
54346
|
+
}).map(function (opt) {
|
|
54347
|
+
return {
|
|
54348
|
+
value: opt.value != null ? String(opt.value) : '',
|
|
54349
|
+
text: opt.text != null ? String(opt.text) : ''
|
|
54350
|
+
};
|
|
54351
|
+
});
|
|
54352
|
+
this.vo.paramValue = JSON.stringify(filtered);
|
|
54353
|
+
var self = this;
|
|
54354
|
+
this.$nextTick(function () {
|
|
54355
|
+
self.syncing = false;
|
|
54356
|
+
});
|
|
54357
|
+
},
|
|
54358
|
+
/**
|
|
54359
|
+
* 新增一行选项
|
|
54360
|
+
*/
|
|
54361
|
+
addOption: function addOption() {
|
|
54362
|
+
this.optionList.push({
|
|
54363
|
+
value: '',
|
|
54364
|
+
text: '',
|
|
54365
|
+
_dragKey: this.nextDragKey()
|
|
54366
|
+
});
|
|
54367
|
+
},
|
|
54368
|
+
/**
|
|
54369
|
+
* 删除指定行选项
|
|
54370
|
+
* @param {number} idx 行下标
|
|
54371
|
+
*/
|
|
54372
|
+
removeOption: function removeOption(idx) {
|
|
54373
|
+
this.optionList.splice(idx, 1);
|
|
54374
|
+
// 删光后保留一行空选项,便于继续录入
|
|
54375
|
+
if (this.optionList.length === 0) {
|
|
54376
|
+
this.optionList.push({
|
|
54377
|
+
value: '',
|
|
54378
|
+
text: '',
|
|
54379
|
+
_dragKey: this.nextDragKey()
|
|
54380
|
+
});
|
|
54381
|
+
}
|
|
54382
|
+
this.syncOptionsToParamValue();
|
|
54383
|
+
}
|
|
54384
|
+
}
|
|
54385
|
+
});
|
|
54386
|
+
;// CONCATENATED MODULE: ./packages/ecwplat/DataDict/src/form.vue?vue&type=script&lang=js
|
|
54387
|
+
/* harmony default export */ var src_formvue_type_script_lang_js = (formvue_type_script_lang_js);
|
|
54388
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwplat/DataDict/src/form.vue?vue&type=style&index=0&id=75222ba9&prod&lang=css
|
|
54389
|
+
var formvue_type_style_index_0_id_75222ba9_prod_lang_css = __webpack_require__(58936);
|
|
54390
|
+
;// CONCATENATED MODULE: ./packages/ecwplat/DataDict/src/form.vue?vue&type=style&index=0&id=75222ba9&prod&lang=css
|
|
54391
|
+
|
|
54392
|
+
// EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
|
|
54393
|
+
var componentNormalizer = __webpack_require__(81656);
|
|
54394
|
+
;// CONCATENATED MODULE: ./packages/ecwplat/DataDict/src/form.vue
|
|
54395
|
+
|
|
54396
|
+
|
|
54397
|
+
|
|
54398
|
+
;
|
|
54399
|
+
|
|
54400
|
+
|
|
54401
|
+
/* normalize component */
|
|
54402
|
+
|
|
54403
|
+
var component = (0,componentNormalizer/* default */.A)(
|
|
54404
|
+
src_formvue_type_script_lang_js,
|
|
54405
|
+
render,
|
|
54406
|
+
staticRenderFns,
|
|
54407
|
+
false,
|
|
54408
|
+
null,
|
|
54409
|
+
null,
|
|
54410
|
+
null
|
|
54411
|
+
|
|
54412
|
+
)
|
|
54413
|
+
|
|
54414
|
+
/* harmony default export */ var src_form = (component.exports);
|
|
54415
|
+
;// CONCATENATED MODULE: ./packages/ecwplat/DataDict/index.js
|
|
54416
|
+
|
|
54417
|
+
src_form.install = function (Vue) {
|
|
54418
|
+
Vue.component(src_form.name, src_form);
|
|
54419
|
+
};
|
|
54420
|
+
var DataDictForm = src_form;
|
|
54421
|
+
|
|
54422
|
+
/***/ }),
|
|
54423
|
+
|
|
53847
54424
|
/***/ 48616:
|
|
53848
54425
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
53849
54426
|
|
|
@@ -166355,6 +166932,27 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".svg-icon[data-v-5d08e6e2]{width:1em;h
|
|
|
166355
166932
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
166356
166933
|
|
|
166357
166934
|
|
|
166935
|
+
/***/ }),
|
|
166936
|
+
|
|
166937
|
+
/***/ 55119:
|
|
166938
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
166939
|
+
|
|
166940
|
+
"use strict";
|
|
166941
|
+
__webpack_require__.r(__webpack_exports__);
|
|
166942
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31601);
|
|
166943
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
166944
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76314);
|
|
166945
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
166946
|
+
// Imports
|
|
166947
|
+
|
|
166948
|
+
|
|
166949
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
166950
|
+
// Module
|
|
166951
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".option-config-table{border-collapse:collapse}.option-config-table td{border:1px solid #ebeef5}.option-config-table .option-header td{background-color:#f5f7fa!important}.option-config-table .sortable-ghost{opacity:.5;background:#f0f9ff}.option-config-table .sortable-fallback{opacity:.9;background:#fff;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.12);box-shadow:0 2px 8px rgba(0,0,0,.12)}", ""]);
|
|
166952
|
+
// Exports
|
|
166953
|
+
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
166954
|
+
|
|
166955
|
+
|
|
166358
166956
|
/***/ }),
|
|
166359
166957
|
|
|
166360
166958
|
/***/ 8943:
|
|
@@ -253001,6 +253599,22 @@ var update = add("2de18074", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
253001
253599
|
|
|
253002
253600
|
/***/ }),
|
|
253003
253601
|
|
|
253602
|
+
/***/ 58936:
|
|
253603
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
253604
|
+
|
|
253605
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
253606
|
+
|
|
253607
|
+
// load the styles
|
|
253608
|
+
var content = __webpack_require__(55119);
|
|
253609
|
+
if(content.__esModule) content = content.default;
|
|
253610
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
253611
|
+
if(content.locals) module.exports = content.locals;
|
|
253612
|
+
// add the styles to the DOM
|
|
253613
|
+
var add = (__webpack_require__(99548)/* ["default"] */ .A)
|
|
253614
|
+
var update = add("24175b53", content, true, {"sourceMap":false,"shadowMode":false});
|
|
253615
|
+
|
|
253616
|
+
/***/ }),
|
|
253617
|
+
|
|
253004
253618
|
/***/ 98760:
|
|
253005
253619
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
253006
253620
|
|
|
@@ -278078,6 +278692,10 @@ var asyncComponents = [
|
|
|
278078
278692
|
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 48616)).then(function (m) {
|
|
278079
278693
|
return m.EditorConfig;
|
|
278080
278694
|
});
|
|
278695
|
+
}], ['DataDictForm', function () {
|
|
278696
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 34719)).then(function (m) {
|
|
278697
|
+
return m.DataDictForm;
|
|
278698
|
+
});
|
|
278081
278699
|
}],
|
|
278082
278700
|
// ========== ecwplus 设计器系列 → chunk: devtool-* ==========
|
|
278083
278701
|
['BusiformDesigner', function () {
|