mooho-base-admin-plus 0.1.0
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/.env +5 -0
- package/.env.development +0 -0
- package/.env.production +0 -0
- package/.eslintignore +11 -0
- package/.eslintrc.js +47 -0
- package/.prettierrc +15 -0
- package/README.md +18 -0
- package/dist/favicon.ico +0 -0
- package/dist/mooho-base-admin-plus.min.esm.js +131746 -0
- package/dist/mooho-base-admin-plus.min.js +279 -0
- package/dist/setting.js +31 -0
- package/dist/static/images/app-barcode.png +0 -0
- package/dist/static/images/login/bg.png +0 -0
- package/dist/static/images/login/logo.png +0 -0
- package/dist/static/images/login/password-active.png +0 -0
- package/dist/static/images/login/password-default.png +0 -0
- package/dist/static/images/login/signIn-img.png +0 -0
- package/dist/static/images/login/user-active.png +0 -0
- package/dist/static/images/login/user-default.png +0 -0
- package/dist/static/images/logo-dark.png +0 -0
- package/dist/static/images/logo-small.png +0 -0
- package/dist/static/images/logo.png +0 -0
- package/dist/static/images/logo.svg +510 -0
- package/dist/static/images/no-image.png +0 -0
- package/dist/style.css +4 -0
- package/index.html +18 -0
- package/other/pda.vue +28 -0
- package/package.json +59 -0
- package/public/favicon.ico +0 -0
- package/public/setting.js +31 -0
- package/public/static/images/app-barcode.png +0 -0
- package/public/static/images/login/bg.png +0 -0
- package/public/static/images/login/logo.png +0 -0
- package/public/static/images/login/password-active.png +0 -0
- package/public/static/images/login/password-default.png +0 -0
- package/public/static/images/login/signIn-img.png +0 -0
- package/public/static/images/login/user-active.png +0 -0
- package/public/static/images/login/user-default.png +0 -0
- package/public/static/images/logo-dark.png +0 -0
- package/public/static/images/logo-small.png +0 -0
- package/public/static/images/logo.png +0 -0
- package/public/static/images/logo.svg +510 -0
- package/public/static/images/no-image.png +0 -0
- package/src/App.vue +60 -0
- package/src/api/application.js +35 -0
- package/src/api/customModel.js +187 -0
- package/src/api/customPage.js +15 -0
- package/src/api/customTable.js +24 -0
- package/src/api/dataSource.js +93 -0
- package/src/api/dataView.js +199 -0
- package/src/api/dictType.js +23 -0
- package/src/api/entityView.js +13 -0
- package/src/api/enum.js +15 -0
- package/src/api/filterColumn.js +16 -0
- package/src/api/model.js +244 -0
- package/src/api/movePlan.js +29 -0
- package/src/api/notification.js +28 -0
- package/src/api/openApiPermission.js +25 -0
- package/src/api/permission.js +51 -0
- package/src/api/planJob.js +15 -0
- package/src/api/process.js +23 -0
- package/src/api/processDef.js +36 -0
- package/src/api/processInst.js +16 -0
- package/src/api/rolePermission.js +17 -0
- package/src/api/roleProperty.js +36 -0
- package/src/api/shortcut.js +20 -0
- package/src/api/system.js +23 -0
- package/src/api/task.js +56 -0
- package/src/api/taskQueue.js +24 -0
- package/src/api/user.js +45 -0
- package/src/api/viewColumn.js +16 -0
- package/src/assets/svg/body.svg +17 -0
- package/src/assets/svg/header-theme-dark.svg +40 -0
- package/src/assets/svg/header-theme-primary.svg +40 -0
- package/src/assets/svg/header-top.svg +40 -0
- package/src/assets/svg/icon-happy.svg +1 -0
- package/src/assets/svg/icon-sad.svg +1 -0
- package/src/assets/svg/icon-social-bilibili.svg +1 -0
- package/src/assets/svg/icon-social-dingding.svg +1 -0
- package/src/assets/svg/icon-social-facebook.svg +1 -0
- package/src/assets/svg/icon-social-juejin.svg +1 -0
- package/src/assets/svg/icon-social-qq.svg +1 -0
- package/src/assets/svg/icon-social-twitter.svg +1 -0
- package/src/assets/svg/icon-social-wechat.svg +1 -0
- package/src/assets/svg/icon-social-weibo.svg +1 -0
- package/src/assets/svg/icon-social-zhihu.svg +1 -0
- package/src/assets/svg/nav-theme-dark.svg +40 -0
- package/src/assets/svg/nav-theme-light.svg +40 -0
- package/src/components/copyright/index.vue +28 -0
- package/src/components/home/notice-list.vue +62 -0
- package/src/components/home/shortcut.vue +125 -0
- package/src/components/input/dialog-select.vue +301 -0
- package/src/components/input/item-select.vue +195 -0
- package/src/components/link/index.vue +54 -0
- package/src/components/richEditor/index.vue +86 -0
- package/src/components/upload/file-upload.vue +84 -0
- package/src/components/upload/upload-attachment.vue +119 -0
- package/src/components/upload/upload-image.vue +212 -0
- package/src/components/view/column-check.vue +223 -0
- package/src/components/view/column-edit.vue +850 -0
- package/src/components/view/column-select.vue +206 -0
- package/src/components/view/condition-edit.vue +164 -0
- package/src/components/view/filter-edit.vue +633 -0
- package/src/components/view/filter-setting.vue +126 -0
- package/src/components/view/form-setting-layout.vue +375 -0
- package/src/components/view/form-setting.vue +247 -0
- package/src/components/view/group-column.vue +104 -0
- package/src/components/view/group-method.vue +104 -0
- package/src/components/view/mixin.js +72 -0
- package/src/components/view/modal-form-filter.vue +319 -0
- package/src/components/view/modal-form-sort.vue +248 -0
- package/src/components/view/modal-form.vue +453 -0
- package/src/components/view/modal-table.vue +471 -0
- package/src/components/view/table-filter.vue +702 -0
- package/src/components/view/table-setting.vue +533 -0
- package/src/components/view/view-chart.vue +423 -0
- package/src/components/view/view-form-draggable.vue +837 -0
- package/src/components/view/view-form.vue +1444 -0
- package/src/components/view/view-table.vue +2261 -0
- package/src/components/workflow/flow-chart.vue +846 -0
- package/src/directive/focus.js +10 -0
- package/src/directive/tabHide.js +9 -0
- package/src/i18n/index.js +15 -0
- package/src/i18n/locale/en-US.js +1 -0
- package/src/i18n/locale/lang.js +1 -0
- package/src/i18n/locale/zh-CN.js +1 -0
- package/src/i18n/locale.js +102 -0
- package/src/index.js +222 -0
- package/src/layouts/basic-layout/header-breadcrumb/index.vue +122 -0
- package/src/layouts/basic-layout/header-collapse/index.vue +44 -0
- package/src/layouts/basic-layout/header-fullscreen/index.vue +19 -0
- package/src/layouts/basic-layout/header-i18n/index.vue +45 -0
- package/src/layouts/basic-layout/header-log/index.vue +41 -0
- package/src/layouts/basic-layout/header-logo/index.vue +23 -0
- package/src/layouts/basic-layout/header-notice/index.vue +218 -0
- package/src/layouts/basic-layout/header-reload/index.vue +21 -0
- package/src/layouts/basic-layout/header-search/index.vue +37 -0
- package/src/layouts/basic-layout/header-setting/index.vue +219 -0
- package/src/layouts/basic-layout/header-user/index.vue +175 -0
- package/src/layouts/basic-layout/i18n.js +50 -0
- package/src/layouts/basic-layout/index.vue +280 -0
- package/src/layouts/basic-layout/menu-head/index.vue +120 -0
- package/src/layouts/basic-layout/menu-head/title.vue +48 -0
- package/src/layouts/basic-layout/menu-side/index.vue +113 -0
- package/src/layouts/basic-layout/menu-side/menu-collapse.vue +76 -0
- package/src/layouts/basic-layout/menu-side/menu-item.vue +31 -0
- package/src/layouts/basic-layout/menu-side/menu-title.vue +56 -0
- package/src/layouts/basic-layout/menu-side/submenu.vue +31 -0
- package/src/layouts/basic-layout/mixins/click-item.js +21 -0
- package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -0
- package/src/layouts/basic-layout/mixins/translate-title.js +11 -0
- package/src/layouts/basic-layout/tabs/index.vue +192 -0
- package/src/layouts/basic-layout/water-mark/index.vue +29 -0
- package/src/libs/lodop/index.js +145 -0
- package/src/libs/random_str.js +10 -0
- package/src/libs/request/index.js +158 -0
- package/src/libs/system/index.js +234 -0
- package/src/libs/util.cookies.js +44 -0
- package/src/libs/util.db.js +13 -0
- package/src/libs/util.js +55 -0
- package/src/libs/util.log.js +88 -0
- package/src/libs/water-mark.js +44 -0
- package/src/menu/header.js +20 -0
- package/src/menu/modules/dashboard.js +23 -0
- package/src/menu/sider.js +12 -0
- package/src/mixins/app.js +9 -0
- package/src/mixins/page.js +643 -0
- package/src/pages/account/login.vue +101 -0
- package/src/pages/common/home.vue +169 -0
- package/src/pages/common/task-form.vue +350 -0
- package/src/pages/common/todo.vue +31 -0
- package/src/pages/system/apiLog.vue +79 -0
- package/src/pages/system/applicationType.vue +182 -0
- package/src/pages/system/customPage.vue +62 -0
- package/src/pages/system/customTable.vue +98 -0
- package/src/pages/system/dict.vue +36 -0
- package/src/pages/system/dictType.vue +58 -0
- package/src/pages/system/entityView.vue +38 -0
- package/src/pages/system/error/404.vue +6 -0
- package/src/pages/system/extendColumn.vue +99 -0
- package/src/pages/system/formView.vue +136 -0
- package/src/pages/system/log.vue +55 -0
- package/src/pages/system/notice.vue +26 -0
- package/src/pages/system/openApi.vue +26 -0
- package/src/pages/system/openUser.vue +66 -0
- package/src/pages/system/organization.vue +98 -0
- package/src/pages/system/organizationType.vue +26 -0
- package/src/pages/system/permission.vue +175 -0
- package/src/pages/system/planJob.vue +40 -0
- package/src/pages/system/printTemplate.vue +48 -0
- package/src/pages/system/process.vue +79 -0
- package/src/pages/system/processType.vue +26 -0
- package/src/pages/system/role.vue +395 -0
- package/src/pages/system/rolePropertyEdit.vue +480 -0
- package/src/pages/system/sequenceSetting.vue +26 -0
- package/src/pages/system/systemData.vue +52 -0
- package/src/pages/system/tableView.vue +386 -0
- package/src/pages/system/taskQueue.vue +48 -0
- package/src/pages/system/user.vue +250 -0
- package/src/pages/template/processPage.vue +243 -0
- package/src/pages/template/reportPage.vue +66 -0
- package/src/pages/template/viewPage.vue +139 -0
- package/src/plugins/auth/index.js +21 -0
- package/src/plugins/error/index.js +31 -0
- package/src/plugins/index.js +24 -0
- package/src/plugins/sweetalert2/index.js +20 -0
- package/src/router/dynamic.js +183 -0
- package/src/router/index.js +84 -0
- package/src/setting.js +202 -0
- package/src/store/index.js +9 -0
- package/src/store/modules/admin/index.js +16 -0
- package/src/store/modules/admin/modules/account.js +103 -0
- package/src/store/modules/admin/modules/cache.js +119 -0
- package/src/store/modules/admin/modules/dataView.js +112 -0
- package/src/store/modules/admin/modules/db.js +231 -0
- package/src/store/modules/admin/modules/i18n.js +87 -0
- package/src/store/modules/admin/modules/layout.js +115 -0
- package/src/store/modules/admin/modules/loader.js +44 -0
- package/src/store/modules/admin/modules/log.js +77 -0
- package/src/store/modules/admin/modules/menu.js +338 -0
- package/src/store/modules/admin/modules/page.js +466 -0
- package/src/store/modules/admin/modules/user.js +96 -0
- package/src/store/modules/admin/modules/viewPage.js +34 -0
- package/src/styles/common.less +47 -0
- package/src/styles/css/default.css +510 -0
- package/src/styles/css/login.css +1217 -0
- package/src/styles/default/index.less +6 -0
- package/src/styles/font/demo.css +539 -0
- package/src/styles/font/demo_index.html +372 -0
- package/src/styles/font/icon-demo/demo.css +539 -0
- package/src/styles/font/icon-demo/demo_index.html +423 -0
- package/src/styles/font/icon-demo/iconfont.css +61 -0
- package/src/styles/font/icon-demo/iconfont.eot +0 -0
- package/src/styles/font/icon-demo/iconfont.js +1 -0
- package/src/styles/font/icon-demo/iconfont.svg +59 -0
- package/src/styles/font/icon-demo/iconfont.ttf +0 -0
- package/src/styles/font/icon-demo/iconfont.woff +0 -0
- package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
- package/src/styles/font/iconfont.css +47 -0
- package/src/styles/font/iconfont.js +1 -0
- package/src/styles/font/iconfont.json +65 -0
- package/src/styles/font/iconfont.ttf +0 -0
- package/src/styles/font/iconfont.woff +0 -0
- package/src/styles/font/iconfont.woff2 +0 -0
- package/src/styles/font/ionicons.svg +870 -0
- package/src/styles/font/ionicons.ttf +0 -0
- package/src/styles/font/ionicons.woff +0 -0
- package/src/styles/font/ionicons.woff2 +0 -0
- package/src/styles/index.less +7 -0
- package/src/styles/layout/basic-layout/layout.less +527 -0
- package/src/styles/layout/basic-layout/menu.less +274 -0
- package/src/styles/layout/index.less +2 -0
- package/src/styles/setting.less +6 -0
- package/styleguide.config.js +22 -0
- package/test/api/barcode.js +50 -0
- package/test/api/inbound.js +47 -0
- package/test/api/interfaceLog.js +15 -0
- package/test/api/interfaceQueue.js +15 -0
- package/test/api/interfaceServer.js +29 -0
- package/test/api/movePlan.js +50 -0
- package/test/api/movePlanItem.js +13 -0
- package/test/api/moveType.js +22 -0
- package/test/api/openApiPermission.js +25 -0
- package/test/api/outbound.js +40 -0
- package/test/api/permission.js +34 -0
- package/test/api/rolePermission.js +17 -0
- package/test/api/user.js +40 -0
- package/test/api/viewColumn.js +16 -0
- package/test/api/warehouse.js +13 -0
- package/test/api/warehouseMoveType.js +18 -0
- package/test/main.js +55 -0
- package/test/package.js +33 -0
- package/test/pages/home/index.vue +22 -0
- package/test/pages/task/test.vue +28 -0
- package/test/pages/test/dataViewTest.vue +28 -0
- package/test/pages/test/logReport.vue +25 -0
- package/test/pages/test/testPage.vue +38 -0
- package/test/router/routes.js +88 -0
- package/test/setting.env.js +22 -0
- package/test/styles/css/custom.css +0 -0
- package/test/styles/css/login.css +1217 -0
- package/vite.config.js +72 -0
- package/vue.config.js +20 -0
|
@@ -0,0 +1,850 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
|
|
4
|
+
<template #header>
|
|
5
|
+
<div>
|
|
6
|
+
<span class="title">字段设置</span>
|
|
7
|
+
<span class="description">Column Setting</span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<div class="ivu-ml-8 ivu-mr-8">
|
|
11
|
+
<Form ref="form" :model="data" label-position="top" label-colon=":" class="ivu-mt" :rules="rules" @submit.prevent>
|
|
12
|
+
<Row :gutter="24" type="flex">
|
|
13
|
+
<Col v-bind="grid8">
|
|
14
|
+
<FormItem label="名称" key="name" prop="name">
|
|
15
|
+
<Input type="text" v-model="data.name" maxlength="200" />
|
|
16
|
+
</FormItem>
|
|
17
|
+
</Col>
|
|
18
|
+
<Col v-bind="grid8" v-if="data.dataView && !data.dataView.isVirtual">
|
|
19
|
+
<FormItem label="虚拟字段" key="isVirtual" prop="isVirtual">
|
|
20
|
+
<Switch :model-value="!!data.isVirtual" @update:model-value="isVirtualChange" />
|
|
21
|
+
</FormItem>
|
|
22
|
+
</Col>
|
|
23
|
+
<Col
|
|
24
|
+
v-bind="grid8"
|
|
25
|
+
v-if="!data.isVirtual && (data.controlType != 'Table' || (data.controlType == 'Table' && data.tableStoreType == 'Inner')) && data.controlType != 'List'"
|
|
26
|
+
>
|
|
27
|
+
<FormItem label="字段代码" key="code" prop="code">
|
|
28
|
+
<Input type="text" readonly v-model="data.code" @on-focus="openSelect()">
|
|
29
|
+
<template #prepend>
|
|
30
|
+
<Button custom-icon="fa fa-search" @click="openSelect()"></Button>
|
|
31
|
+
</template>
|
|
32
|
+
</Input>
|
|
33
|
+
</FormItem>
|
|
34
|
+
</Col>
|
|
35
|
+
<Col v-bind="grid8" v-if="data.isVirtual || (data.controlType == 'Table' && data.tableStoreType == 'Outer')">
|
|
36
|
+
<FormItem label="字段代码" key="code" prop="code">
|
|
37
|
+
<Input type="text" v-model="data.code" maxlength="200" />
|
|
38
|
+
</FormItem>
|
|
39
|
+
</Col>
|
|
40
|
+
<Col v-bind="grid8" v-if="data.isVirtual == true">
|
|
41
|
+
<FormItem label="字段类型" key="dataType" prop="dataType">
|
|
42
|
+
<Select v-model="data.dataType" :transfer="true">
|
|
43
|
+
<Option v-for="item in getEnumList('DataType')" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
44
|
+
</Select>
|
|
45
|
+
</FormItem>
|
|
46
|
+
</Col>
|
|
47
|
+
<Col v-bind="grid8" v-if="data.isVirtual != true">
|
|
48
|
+
<FormItem label="字段类型" key="dataType" prop="dataType">
|
|
49
|
+
{{ getEnum('DataType', data.dataType) }}
|
|
50
|
+
</FormItem>
|
|
51
|
+
</Col>
|
|
52
|
+
<Col v-bind="grid8">
|
|
53
|
+
<FormItem label="控件类型" key="controlType" prop="controlType">
|
|
54
|
+
<Select v-model="data.controlType" :transfer="true" @on-change="controlTypeChange">
|
|
55
|
+
<Option v-for="item in getEnumList('ControlType')" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
56
|
+
</Select>
|
|
57
|
+
</FormItem>
|
|
58
|
+
</Col>
|
|
59
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Table'">
|
|
60
|
+
<FormItem label="数据存储方式" key="tableStoreType" prop="tableStoreType">
|
|
61
|
+
<RadioGroup v-model="data.tableStoreType" @on-change="tableStoreTypeChange">
|
|
62
|
+
<Radio label="Outer">外部关联表</Radio>
|
|
63
|
+
<Radio label="Inner">表内存储</Radio>
|
|
64
|
+
</RadioGroup>
|
|
65
|
+
</FormItem>
|
|
66
|
+
</Col>
|
|
67
|
+
<Col
|
|
68
|
+
v-bind="grid8"
|
|
69
|
+
v-if="
|
|
70
|
+
data.controlType == 'Select' ||
|
|
71
|
+
data.controlType == 'SelectWithOther' ||
|
|
72
|
+
data.controlType == 'ComboSelect' ||
|
|
73
|
+
data.controlType == 'MultiSelect' ||
|
|
74
|
+
data.controlType == 'Radio' ||
|
|
75
|
+
data.controlType == 'CheckGroup'
|
|
76
|
+
"
|
|
77
|
+
>
|
|
78
|
+
<FormItem label="固定选项" key="isStaticItem" prop="isStaticItem">
|
|
79
|
+
<Switch
|
|
80
|
+
:model-value="!!data.isStaticItem"
|
|
81
|
+
@update:model-value="
|
|
82
|
+
$event => {
|
|
83
|
+
data.isStaticItem = $event;
|
|
84
|
+
//$forceUpdate();
|
|
85
|
+
}
|
|
86
|
+
"
|
|
87
|
+
/>
|
|
88
|
+
</FormItem>
|
|
89
|
+
</Col>
|
|
90
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Select' || data.controlType == 'SelectWithOther' || data.controlType == 'ComboSelect'">
|
|
91
|
+
<FormItem label="默认第一项" key="isDefaultFirst" prop="isDefaultFirst">
|
|
92
|
+
<Switch
|
|
93
|
+
:model-value="!!data.isDefaultFirst"
|
|
94
|
+
@update:model-value="
|
|
95
|
+
$event => {
|
|
96
|
+
data.isDefaultFirst = $event;
|
|
97
|
+
//$forceUpdate();
|
|
98
|
+
}
|
|
99
|
+
"
|
|
100
|
+
/>
|
|
101
|
+
</FormItem>
|
|
102
|
+
</Col>
|
|
103
|
+
<Col
|
|
104
|
+
v-bind="grid24"
|
|
105
|
+
v-if="
|
|
106
|
+
data.isStaticItem &&
|
|
107
|
+
(data.controlType == 'Select' ||
|
|
108
|
+
data.controlType == 'SelectWithOther' ||
|
|
109
|
+
data.controlType == 'ComboSelect' ||
|
|
110
|
+
data.controlType == 'MultiSelect' ||
|
|
111
|
+
data.controlType == 'Radio' ||
|
|
112
|
+
data.controlType == 'CheckGroup')
|
|
113
|
+
"
|
|
114
|
+
>
|
|
115
|
+
<FormItem label="选项内容(每一行为一项,key/value用冒号分隔,没有冒号表示key/value一致)" key="itemData" prop="itemData">
|
|
116
|
+
<Input type="textarea" :rows="5" v-model="data.itemData" />
|
|
117
|
+
</FormItem>
|
|
118
|
+
</Col>
|
|
119
|
+
<Col
|
|
120
|
+
v-bind="grid8"
|
|
121
|
+
v-if="needDataSource && data.controlType != 'DialogSelect' && data.controlType != 'MultiDialogSelect' && data.controlType != 'Table' && data.controlType != 'List'"
|
|
122
|
+
>
|
|
123
|
+
<FormItem label="数据源" key="source" prop="source">
|
|
124
|
+
<dialog-select
|
|
125
|
+
ref="select"
|
|
126
|
+
v-model="data.source"
|
|
127
|
+
source="EntitySelect"
|
|
128
|
+
source-data-code="name"
|
|
129
|
+
source-display-code="name"
|
|
130
|
+
@on-change="sourceChange"
|
|
131
|
+
></dialog-select>
|
|
132
|
+
</FormItem>
|
|
133
|
+
</Col>
|
|
134
|
+
<Col v-bind="grid8" v-if="data.controlType == 'DialogSelect' || data.controlType == 'MultiDialogSelect' || data.controlType == 'Table' || data.controlType == 'List'">
|
|
135
|
+
<FormItem label="视图" key="dataViewSource" prop="dataViewSource">
|
|
136
|
+
<dialog-select
|
|
137
|
+
ref="dataViewSource"
|
|
138
|
+
v-model="data.source"
|
|
139
|
+
source="DataViewSelect"
|
|
140
|
+
source-data-code="code"
|
|
141
|
+
source-display-code="code"
|
|
142
|
+
:param="{ viewType: 'TableView' }"
|
|
143
|
+
@on-change="sourceChange"
|
|
144
|
+
></dialog-select>
|
|
145
|
+
</FormItem>
|
|
146
|
+
</Col>
|
|
147
|
+
<Col
|
|
148
|
+
v-bind="grid8"
|
|
149
|
+
v-if="data.source && needDataSource && (data.controlType != 'Table' || (data.controlType == 'Table' && data.tableStoreType == 'Outer')) && data.controlType != 'List'"
|
|
150
|
+
>
|
|
151
|
+
<FormItem label="数据字段" prop="sourceDataCode">
|
|
152
|
+
<Input type="text" :readonly="true" v-model="data.sourceDataCode" @on-focus="openColumnSelect(data, 'sourceDataCode')">
|
|
153
|
+
<template #prepend>
|
|
154
|
+
<Button custom-icon="fa fa-search" @click="openColumnSelect(data, 'sourceDataCode')"></Button>
|
|
155
|
+
</template>
|
|
156
|
+
</Input>
|
|
157
|
+
</FormItem>
|
|
158
|
+
</Col>
|
|
159
|
+
<Col v-bind="grid8" v-if="data.source && needDataSource && data.controlType != 'Table' && data.controlType != 'List'">
|
|
160
|
+
<FormItem label="显示字段" key="sourceDisplayCode" prop="sourceDisplayCode">
|
|
161
|
+
<Input type="text" :readonly="true" v-model="data.sourceDisplayCode" @on-focus="openColumnSelect(data, 'sourceDisplayCode')">
|
|
162
|
+
<template #prepend>
|
|
163
|
+
<Button custom-icon="fa fa-search" @click="openColumnSelect(data, 'sourceDisplayCode')"></Button>
|
|
164
|
+
</template>
|
|
165
|
+
</Input>
|
|
166
|
+
</FormItem>
|
|
167
|
+
</Col>
|
|
168
|
+
<Col v-bind="grid16" v-if="data.source && needDataSource && data.controlType != 'Table'">
|
|
169
|
+
<FormItem label="参数" key="param" prop="param">
|
|
170
|
+
<Input type="text" @click="paramOpen" :readonly="true" v-model="data.param" maxlength="200" />
|
|
171
|
+
</FormItem>
|
|
172
|
+
</Col>
|
|
173
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Hyperlink'">
|
|
174
|
+
<FormItem label="链接地址" key="hyperlink" prop="hyperlink">
|
|
175
|
+
<Input type="text" v-model="data.hyperlink" maxlength="200" />
|
|
176
|
+
</FormItem>
|
|
177
|
+
</Col>
|
|
178
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Hyperlink'">
|
|
179
|
+
<FormItem label="打开新页面" key="isNewWindow" prop="isNewWindow">
|
|
180
|
+
<Switch
|
|
181
|
+
:model-value="!!data.isNewWindow"
|
|
182
|
+
@update:model-value="
|
|
183
|
+
$event => {
|
|
184
|
+
data.isNewWindow = $event;
|
|
185
|
+
//$forceUpdate();
|
|
186
|
+
}
|
|
187
|
+
"
|
|
188
|
+
/>
|
|
189
|
+
</FormItem>
|
|
190
|
+
</Col>
|
|
191
|
+
<Col v-bind="grid8">
|
|
192
|
+
<FormItem label="是否显示" key="isShow" prop="isShow">
|
|
193
|
+
<Switch
|
|
194
|
+
:model-value="!!data.isShow"
|
|
195
|
+
v-if="showCheck(data.showJson)"
|
|
196
|
+
@update:model-value="
|
|
197
|
+
$event => {
|
|
198
|
+
data.isShow = $event;
|
|
199
|
+
//$forceUpdate();
|
|
200
|
+
}
|
|
201
|
+
"
|
|
202
|
+
@on-change="checkChange('showJson', 'isShow')"
|
|
203
|
+
/>
|
|
204
|
+
<Button style="margin-left: 8px" @click="$refs.conditionEdit.open(data, 'showJson', 'isShow', data.dataView.model)" type="primary" size="small" icon="ios-settings">
|
|
205
|
+
条件
|
|
206
|
+
</Button>
|
|
207
|
+
</FormItem>
|
|
208
|
+
</Col>
|
|
209
|
+
<Col v-bind="grid8">
|
|
210
|
+
<FormItem label="是否只读" key="isReadonly" prop="isReadonly">
|
|
211
|
+
<Switch
|
|
212
|
+
:model-value="!!data.isReadonly"
|
|
213
|
+
v-if="showCheck(data.readonlyJson)"
|
|
214
|
+
@update:model-value="
|
|
215
|
+
$event => {
|
|
216
|
+
data.isReadonly = $event;
|
|
217
|
+
//$forceUpdate();
|
|
218
|
+
}
|
|
219
|
+
"
|
|
220
|
+
@on-change="checkChange('readonlyJson', 'isReadonly')"
|
|
221
|
+
/>
|
|
222
|
+
<Button
|
|
223
|
+
style="margin-left: 8px"
|
|
224
|
+
@click="$refs.conditionEdit.open(data, 'readonlyJson', 'isReadonly', data.dataView.model)"
|
|
225
|
+
type="primary"
|
|
226
|
+
size="small"
|
|
227
|
+
icon="ios-settings"
|
|
228
|
+
>
|
|
229
|
+
条件
|
|
230
|
+
</Button>
|
|
231
|
+
</FormItem>
|
|
232
|
+
</Col>
|
|
233
|
+
<Col v-bind="grid8" v-if="viewType == 'FormView'">
|
|
234
|
+
<FormItem label="栏目宽度" key="columnWidth" prop="columnWidth">
|
|
235
|
+
<Select v-model="data.columnWidth" clearable :transfer="true">
|
|
236
|
+
<Option v-for="item in getEnumList('ColumnWidth')" :key="item.id" :value="item.id">{{ item.name }}</Option>
|
|
237
|
+
</Select>
|
|
238
|
+
</FormItem>
|
|
239
|
+
</Col>
|
|
240
|
+
<Col v-bind="grid8">
|
|
241
|
+
<FormItem label="控件宽度" key="controlWidth" prop="controlWidth">
|
|
242
|
+
<Input type="number" style="width: 100px" number v-model="data.controlWidth" />
|
|
243
|
+
</FormItem>
|
|
244
|
+
</Col>
|
|
245
|
+
<Col v-bind="grid8" v-if="data.controlType == 'TextArea' || data.controlType == 'RichEditor' || data.controlType == 'Image'">
|
|
246
|
+
<FormItem label="控件高度" key="controlHeight" prop="controlHeight">
|
|
247
|
+
<Input type="number" style="width: 100px" number v-model="data.controlHeight" />
|
|
248
|
+
</FormItem>
|
|
249
|
+
</Col>
|
|
250
|
+
<Col v-bind="grid8">
|
|
251
|
+
<FormItem label="显示格式" key="displayFormat" prop="displayFormat">
|
|
252
|
+
<Select v-model="data.displayFormat" clearable :transfer="true">
|
|
253
|
+
<Option v-for="item in getDisplayFormats()" :key="item.id" :value="item.code">{{ item.name }}</Option>
|
|
254
|
+
</Select>
|
|
255
|
+
</FormItem>
|
|
256
|
+
</Col>
|
|
257
|
+
<Col v-bind="grid8">
|
|
258
|
+
<FormItem label="是否必填" key="isRequired" prop="isRequired">
|
|
259
|
+
<Switch
|
|
260
|
+
:model-value="!!data.isRequired"
|
|
261
|
+
v-if="showCheck(data.requiredJson)"
|
|
262
|
+
@update:model-value="
|
|
263
|
+
$event => {
|
|
264
|
+
data.isRequired = $event;
|
|
265
|
+
//$forceUpdate();
|
|
266
|
+
}
|
|
267
|
+
"
|
|
268
|
+
@on-change="checkChange('requiredJson', 'isRequired')"
|
|
269
|
+
/>
|
|
270
|
+
<Button
|
|
271
|
+
style="margin-left: 8px"
|
|
272
|
+
@click="$refs.conditionEdit.open(data, 'requiredJson', 'isRequired', data.dataView.model)"
|
|
273
|
+
type="primary"
|
|
274
|
+
size="small"
|
|
275
|
+
icon="ios-settings"
|
|
276
|
+
>
|
|
277
|
+
条件
|
|
278
|
+
</Button>
|
|
279
|
+
</FormItem>
|
|
280
|
+
</Col>
|
|
281
|
+
<Col v-bind="grid8">
|
|
282
|
+
<FormItem label="默认值" key="defaultValue" prop="defaultValue">
|
|
283
|
+
<Input type="text" v-model="data.defaultValue" maxlength="200" />
|
|
284
|
+
</FormItem>
|
|
285
|
+
</Col>
|
|
286
|
+
<Col v-bind="grid8">
|
|
287
|
+
<FormItem label="描述" key="description" prop="description">
|
|
288
|
+
<Input type="text" v-model="data.description" maxlength="200" />
|
|
289
|
+
</FormItem>
|
|
290
|
+
</Col>
|
|
291
|
+
<Col v-bind="grid8" v-if="data.controlType == 'TextInput' || data.controlType == 'TextArea'">
|
|
292
|
+
<FormItem label="最大字符数量" key="maxLength" prop="maxLength">
|
|
293
|
+
<Input type="number" style="width: 100px" number v-model="data.maxLength" />
|
|
294
|
+
</FormItem>
|
|
295
|
+
</Col>
|
|
296
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Attachment' || data.controlType == 'Image'">
|
|
297
|
+
<FormItem label="最大文件数量" key="maxLength" prop="maxLength">
|
|
298
|
+
<Input type="number" style="width: 100px" number v-model="data.maxLength" />
|
|
299
|
+
</FormItem>
|
|
300
|
+
</Col>
|
|
301
|
+
<Col v-bind="grid8" v-if="data.controlType == 'NumberInput' || data.controlType == 'Slider'">
|
|
302
|
+
<FormItem
|
|
303
|
+
label="
|
|
304
|
+
输入范围"
|
|
305
|
+
>
|
|
306
|
+
<Input type="number" style="width: 60px" number v-model="data.minValue" />
|
|
307
|
+
-
|
|
308
|
+
<Input type="number" style="width: 60px" number v-model="data.maxValue" />
|
|
309
|
+
</FormItem>
|
|
310
|
+
</Col>
|
|
311
|
+
<Col v-bind="grid8">
|
|
312
|
+
<FormItem
|
|
313
|
+
label="
|
|
314
|
+
显示保留小数位"
|
|
315
|
+
key="digit"
|
|
316
|
+
prop="digit"
|
|
317
|
+
>
|
|
318
|
+
<Input type="number" style="width: 100px" number v-model="data.digit" />
|
|
319
|
+
</FormItem>
|
|
320
|
+
</Col>
|
|
321
|
+
<Col v-bind="grid8">
|
|
322
|
+
<FormItem label="固定保留小数位" key="fixedDigit" prop="fixedDigit">
|
|
323
|
+
<Switch
|
|
324
|
+
:model-value="!!data.fixedDigit"
|
|
325
|
+
@update:model-value="
|
|
326
|
+
$event => {
|
|
327
|
+
data.fixedDigit = $event;
|
|
328
|
+
//$forceUpdate();
|
|
329
|
+
}
|
|
330
|
+
"
|
|
331
|
+
/>
|
|
332
|
+
</FormItem>
|
|
333
|
+
</Col>
|
|
334
|
+
<Col v-bind="grid8" v-if="viewType == 'FormView'">
|
|
335
|
+
<FormItem label="强制换行" key="newLine" prop="newLine">
|
|
336
|
+
<Switch
|
|
337
|
+
:model-value="!!data.newLine"
|
|
338
|
+
@update:model-value="
|
|
339
|
+
$event => {
|
|
340
|
+
data.newLine = $event;
|
|
341
|
+
//$forceUpdate();
|
|
342
|
+
}
|
|
343
|
+
"
|
|
344
|
+
/>
|
|
345
|
+
</FormItem>
|
|
346
|
+
</Col>
|
|
347
|
+
<Col v-bind="grid8" v-if="viewType == 'TableView'">
|
|
348
|
+
<FormItem label="父单元格代码" key="parentCode" prop="parentCode">
|
|
349
|
+
<Input type="text" v-model="data.parentCode" maxlength="200" />
|
|
350
|
+
</FormItem>
|
|
351
|
+
</Col>
|
|
352
|
+
<Col v-bind="grid8" v-if="viewType == 'TableView'">
|
|
353
|
+
<FormItem label="合并单元格" key="mergeSame" prop="mergeSame">
|
|
354
|
+
<Switch
|
|
355
|
+
:model-value="!!data.mergeSame"
|
|
356
|
+
@update:model-value="
|
|
357
|
+
$event => {
|
|
358
|
+
data.mergeSame = $event;
|
|
359
|
+
//$forceUpdate();
|
|
360
|
+
}
|
|
361
|
+
"
|
|
362
|
+
/>
|
|
363
|
+
</FormItem>
|
|
364
|
+
</Col>
|
|
365
|
+
<Col v-bind="grid8" v-if="data.controlType == 'TextInput'">
|
|
366
|
+
<FormItem label="验证表达式" key="pattern" prop="pattern">
|
|
367
|
+
<Input type="text" v-model="data.pattern" maxlength="100" />
|
|
368
|
+
</FormItem>
|
|
369
|
+
</Col>
|
|
370
|
+
<Col v-bind="grid8" v-if="data.controlType == 'Attachment'">
|
|
371
|
+
<FormItem label="接受的文件类型" key="pattern" prop="pattern">
|
|
372
|
+
<Input type="text" v-model="data.pattern" maxlength="100" />
|
|
373
|
+
</FormItem>
|
|
374
|
+
</Col>
|
|
375
|
+
<Col v-bind="grid8" v-if="viewType == 'FormView'">
|
|
376
|
+
<FormItem label="选项卡序号" key="tabIndex" prop="tabIndex">
|
|
377
|
+
<Input type="number" style="width: 100px" number v-model="data.tabIndex" />
|
|
378
|
+
</FormItem>
|
|
379
|
+
</Col>
|
|
380
|
+
<Col v-bind="grid24">
|
|
381
|
+
<FormItem label="计算表达式" key="calculate" prop="calculate">
|
|
382
|
+
<Input type="text" v-model="data.calculate" maxlength="500" />
|
|
383
|
+
</FormItem>
|
|
384
|
+
</Col>
|
|
385
|
+
</Row>
|
|
386
|
+
</Form>
|
|
387
|
+
</div>
|
|
388
|
+
<template #footer>
|
|
389
|
+
<div>
|
|
390
|
+
<Button type="primary" custom-icon="fa fa-check" @click="finish">确定</Button>
|
|
391
|
+
<Button type="default" custom-icon="fa fa-times" @click="close">关闭</Button>
|
|
392
|
+
</div>
|
|
393
|
+
</template>
|
|
394
|
+
</Modal>
|
|
395
|
+
<Modal v-model="paramOpened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="600">
|
|
396
|
+
<template #header>
|
|
397
|
+
<div>
|
|
398
|
+
<slot name="header">
|
|
399
|
+
<span class="title">参数</span>
|
|
400
|
+
<span class="description">Param</span>
|
|
401
|
+
</slot>
|
|
402
|
+
</div>
|
|
403
|
+
</template>
|
|
404
|
+
<div class="i-table-no-border">
|
|
405
|
+
<Table :columns="parpamColumns" :data="params" stripe size="small" no-data-text="暂无数据...">
|
|
406
|
+
<template #command="{ index }">
|
|
407
|
+
<Button size="small" title="编辑" type="primary" ghost custom-icon="fa fa-edit" @click="paramEdit(params[index], index)"></Button>
|
|
408
|
+
<Button size="small" title="上移" type="primary" ghost custom-icon="fa fa-chevron-up" @click="upParam(params[index], index)"></Button>
|
|
409
|
+
<Button size="small" title="下移" type="primary" ghost custom-icon="fa fa-chevron-down" @click="downParam(params[index], index)"></Button>
|
|
410
|
+
<Button size="small" title="移除" type="primary" ghost custom-icon="fa fa-times" @click="paramRemove(params[index], index)"></Button>
|
|
411
|
+
</template>
|
|
412
|
+
</Table>
|
|
413
|
+
</div>
|
|
414
|
+
<template #footer>
|
|
415
|
+
<div>
|
|
416
|
+
<Button type="primary" ghost custom-icon="fa fa-plus" @click="paramEdit()">新增</Button>
|
|
417
|
+
<Button type="primary" custom-icon="fa fa-check" @click="paramSave">确定</Button>
|
|
418
|
+
</div>
|
|
419
|
+
</template>
|
|
420
|
+
</Modal>
|
|
421
|
+
<Modal v-model="paramItemOpened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
|
|
422
|
+
<template #header>
|
|
423
|
+
<div>
|
|
424
|
+
<span class="title">参数设置</span>
|
|
425
|
+
<span class="description">Param Setting</span>
|
|
426
|
+
</div>
|
|
427
|
+
</template>
|
|
428
|
+
<div class="ivu-ml-8 ivu-mr-8">
|
|
429
|
+
<Form ref="paramItemForm" :rules="paramItemFormRules" :model="paramData" label-position="top" label-colon=":" class="ivu-mt" @submit.prevent>
|
|
430
|
+
<Row :gutter="24" type="flex">
|
|
431
|
+
<Col v-bind="grid8">
|
|
432
|
+
<FormItem label="字段" key="code" prop="code">
|
|
433
|
+
<Input type="text" v-model="paramData.code">
|
|
434
|
+
<template #prepend>
|
|
435
|
+
<Button custom-icon="fa fa-search" @click="openColumnSelect(paramData, 'code')"></Button>
|
|
436
|
+
</template>
|
|
437
|
+
</Input>
|
|
438
|
+
</FormItem>
|
|
439
|
+
</Col>
|
|
440
|
+
<Col v-bind="grid8">
|
|
441
|
+
<FormItem label="字段类型" key="keyType" prop="keyType">
|
|
442
|
+
<RadioGroup v-model="paramData.keyType" @on-change="keyTypeChange">
|
|
443
|
+
<Radio label="常量"></Radio>
|
|
444
|
+
<Radio label="变量"></Radio>
|
|
445
|
+
</RadioGroup>
|
|
446
|
+
</FormItem>
|
|
447
|
+
</Col>
|
|
448
|
+
<Col v-bind="grid8" v-if="paramData.keyType == '常量'">
|
|
449
|
+
<FormItem label="值" key="val" prop="val">
|
|
450
|
+
<Input type="text" v-model="paramData.val" />
|
|
451
|
+
</FormItem>
|
|
452
|
+
</Col>
|
|
453
|
+
<Col v-bind="grid8" v-if="paramData.keyType == '变量'">
|
|
454
|
+
<FormItem label="值" key="val2" prop="val">
|
|
455
|
+
<Input type="text" v-model="paramData.val">
|
|
456
|
+
<template #prepend>
|
|
457
|
+
<Button custom-icon="fa fa-search" @click="openValueSelect"></Button>
|
|
458
|
+
</template>
|
|
459
|
+
</Input>
|
|
460
|
+
</FormItem>
|
|
461
|
+
</Col>
|
|
462
|
+
</Row>
|
|
463
|
+
</Form>
|
|
464
|
+
</div>
|
|
465
|
+
<template #footer>
|
|
466
|
+
<div>
|
|
467
|
+
<Button type="primary" custom-icon="fa fa-check" @click="paramItemSave">确定</Button>
|
|
468
|
+
<Button type="default" custom-icon="fa fa-times" @click="paramItemClose">关闭</Button>
|
|
469
|
+
</div>
|
|
470
|
+
</template>
|
|
471
|
+
</Modal>
|
|
472
|
+
<column-check ref="columnCheck" />
|
|
473
|
+
<condition-edit ref="conditionEdit" />
|
|
474
|
+
</div>
|
|
475
|
+
</template>
|
|
476
|
+
<script>
|
|
477
|
+
import mixinPage from '../../mixins/page';
|
|
478
|
+
import modelApi from '../../api/model';
|
|
479
|
+
import columnCheck from './column-check';
|
|
480
|
+
import conditionEdit from './condition-edit';
|
|
481
|
+
|
|
482
|
+
export default {
|
|
483
|
+
mixins: [mixinPage],
|
|
484
|
+
components: { columnCheck, conditionEdit },
|
|
485
|
+
data() {
|
|
486
|
+
return {
|
|
487
|
+
data: {},
|
|
488
|
+
index: null,
|
|
489
|
+
columns: [],
|
|
490
|
+
opened: false,
|
|
491
|
+
callback: null,
|
|
492
|
+
displayFormats: [],
|
|
493
|
+
parpamColumns: [
|
|
494
|
+
{ title: '参数', resizable: true, align: 'center', key: 'code' },
|
|
495
|
+
{ title: '值', align: 'center', resizable: true, key: 'val' },
|
|
496
|
+
{ slot: 'command', title: ' ', align: 'center', resizable: true, fixed: 'right' }
|
|
497
|
+
],
|
|
498
|
+
params: [],
|
|
499
|
+
paramData: {},
|
|
500
|
+
rules: {
|
|
501
|
+
code: {
|
|
502
|
+
type: 'string',
|
|
503
|
+
required: true,
|
|
504
|
+
message: '请输入字段',
|
|
505
|
+
trigger: 'blur,change'
|
|
506
|
+
},
|
|
507
|
+
// name: {
|
|
508
|
+
// type: 'string',
|
|
509
|
+
// required: true,
|
|
510
|
+
// message: '请输入名称',
|
|
511
|
+
// trigger: 'blur,change'
|
|
512
|
+
// },
|
|
513
|
+
controlType: {
|
|
514
|
+
type: 'string',
|
|
515
|
+
required: true,
|
|
516
|
+
message: '请输入控件类型',
|
|
517
|
+
trigger: 'blur,change'
|
|
518
|
+
},
|
|
519
|
+
columnWidth: {
|
|
520
|
+
type: 'string',
|
|
521
|
+
required: true,
|
|
522
|
+
message: '请输入栏目宽度',
|
|
523
|
+
trigger: 'blur,change'
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
paramItemFormRules: {
|
|
527
|
+
code: {
|
|
528
|
+
type: 'string',
|
|
529
|
+
required: true,
|
|
530
|
+
message: '请输入字段名称',
|
|
531
|
+
trigger: 'blur,change'
|
|
532
|
+
},
|
|
533
|
+
keyType: {
|
|
534
|
+
type: 'string',
|
|
535
|
+
required: true,
|
|
536
|
+
message: '请选择字段类型',
|
|
537
|
+
trigger: 'blur,change'
|
|
538
|
+
},
|
|
539
|
+
val: {
|
|
540
|
+
type: 'string',
|
|
541
|
+
required: true,
|
|
542
|
+
message: '请输入值',
|
|
543
|
+
trigger: 'blur,change'
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
paramOpened: false,
|
|
547
|
+
paramItemOpened: false,
|
|
548
|
+
sourceBefore: null
|
|
549
|
+
};
|
|
550
|
+
},
|
|
551
|
+
async created() {
|
|
552
|
+
// 获取所有显示格式
|
|
553
|
+
let res = await modelApi.query('DisplayFormat', {});
|
|
554
|
+
this.displayFormats = res.data;
|
|
555
|
+
},
|
|
556
|
+
props: {
|
|
557
|
+
// 视图类型
|
|
558
|
+
viewType: {
|
|
559
|
+
type: String
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
computed: {
|
|
563
|
+
// 选择框,或复选框组,且非枚举类型,需要输入数据源
|
|
564
|
+
needDataSource() {
|
|
565
|
+
if (this.data) {
|
|
566
|
+
return (
|
|
567
|
+
((this.data.controlType === 'Select' ||
|
|
568
|
+
this.data.controlType === 'MultiSelect' ||
|
|
569
|
+
this.data.controlType === 'TreeSelect' ||
|
|
570
|
+
this.data.controlType === 'MultiTreeSelect' ||
|
|
571
|
+
this.data.controlType === 'SelectWithOther' ||
|
|
572
|
+
this.data.controlType === 'ComboSelect' ||
|
|
573
|
+
this.data.controlType === 'Radio' ||
|
|
574
|
+
this.data.controlType === 'CheckGroup') &&
|
|
575
|
+
!this.data.isStaticItem &&
|
|
576
|
+
this.data.dataType &&
|
|
577
|
+
this.data.dataType.indexOf('Enum:') !== 0) ||
|
|
578
|
+
this.data.controlType === 'DialogSelect' ||
|
|
579
|
+
this.data.controlType === 'MultiDialogSelect' ||
|
|
580
|
+
this.data.controlType === 'Table' ||
|
|
581
|
+
this.data.controlType === 'List'
|
|
582
|
+
);
|
|
583
|
+
} else {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
methods: {
|
|
589
|
+
// 打开
|
|
590
|
+
open(row, index, columns, callback) {
|
|
591
|
+
this.data = this.copy(row);
|
|
592
|
+
|
|
593
|
+
this.callback = callback;
|
|
594
|
+
this.opened = true;
|
|
595
|
+
this.$refs.form.resetFields();
|
|
596
|
+
this.controlTypeBefore = this.data.controlType;
|
|
597
|
+
this.index = index;
|
|
598
|
+
this.columns = columns;
|
|
599
|
+
},
|
|
600
|
+
// 关闭
|
|
601
|
+
close() {
|
|
602
|
+
this.opened = false;
|
|
603
|
+
},
|
|
604
|
+
// 确认
|
|
605
|
+
async finish() {
|
|
606
|
+
let isOK = await this.$refs.form.validate();
|
|
607
|
+
|
|
608
|
+
if (!isOK) {
|
|
609
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
610
|
+
} else {
|
|
611
|
+
if (
|
|
612
|
+
this.columns.some((item, index) => {
|
|
613
|
+
return item.code == this.data.code && index != this.index;
|
|
614
|
+
})
|
|
615
|
+
) {
|
|
616
|
+
this.error('字段有重复!');
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
this.callback(this.copy(this.data));
|
|
621
|
+
this.opened = false;
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
// 过滤显示格式
|
|
625
|
+
getDisplayFormats() {
|
|
626
|
+
return this.displayFormats.filter(item => {
|
|
627
|
+
return item.dataType === this.data.dataType;
|
|
628
|
+
});
|
|
629
|
+
},
|
|
630
|
+
// 控件类型变更
|
|
631
|
+
controlTypeChange() {
|
|
632
|
+
if (this.data.sourceModel) {
|
|
633
|
+
if (this.data.controlType == 'DialogSelect' || this.data.controlType == 'MultiDialogSelect') {
|
|
634
|
+
this.data.source = this.data.sourceModel + 'Select';
|
|
635
|
+
} else {
|
|
636
|
+
this.data.source = this.data.sourceModel;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
setTimeout(() => {
|
|
641
|
+
//this.$forceUpdate();
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
// 数据源变更
|
|
645
|
+
sourceChange(row) {
|
|
646
|
+
if (this.sourceBefore != this.data.source) {
|
|
647
|
+
this.data.sourceDisplayCode = null;
|
|
648
|
+
this.data.sourceDataCode = null;
|
|
649
|
+
this.data.sourceModel = null;
|
|
650
|
+
this.data.param = null;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (row) {
|
|
654
|
+
this.data.sourceModel = row.model;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
this.sourceBefore = this.data.source;
|
|
658
|
+
},
|
|
659
|
+
// 打开字段选择界面
|
|
660
|
+
openColumnSelect(data, code) {
|
|
661
|
+
if (this.data.source == null) {
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
let model;
|
|
666
|
+
if (this.data.controlType == 'DialogSelect' || this.data.controlType == 'MultiDialogSelect' || this.data.controlType == 'Table' || this.data.controlType == 'List') {
|
|
667
|
+
model = this.$refs.dataViewSource.selectedData.model;
|
|
668
|
+
} else {
|
|
669
|
+
model = this.data.source;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
this.$refs.columnCheck.open(model, checked => {
|
|
673
|
+
data[code] = checked.code;
|
|
674
|
+
//this.$forceUpdate();
|
|
675
|
+
});
|
|
676
|
+
},
|
|
677
|
+
// 打开变量字段选择界面
|
|
678
|
+
openValueSelect() {
|
|
679
|
+
if (this.data.dataView.model != null) {
|
|
680
|
+
this.$refs.columnCheck.open(this.data.dataView.model, checked => {
|
|
681
|
+
this.paramData.val = checked.code;
|
|
682
|
+
//this.$forceUpdate();
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
// 打开参数弹框
|
|
687
|
+
paramOpen() {
|
|
688
|
+
this.params = [];
|
|
689
|
+
this.paramOpened = true;
|
|
690
|
+
if (this.data.param != null && this.data.param != '') {
|
|
691
|
+
let obj = JSON.parse(this.data.param);
|
|
692
|
+
for (let key in obj) {
|
|
693
|
+
let type = '变量';
|
|
694
|
+
if (obj[key].indexOf('[') == 0 && obj[key].indexOf(']') + 1 == obj[key].length) {
|
|
695
|
+
type = '常量';
|
|
696
|
+
}
|
|
697
|
+
this.params.push({
|
|
698
|
+
code: key,
|
|
699
|
+
val: obj[key],
|
|
700
|
+
type: type
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
// 参数框确认
|
|
706
|
+
async paramItemSave() {
|
|
707
|
+
let isOK = await this.$refs.paramItemForm.validate();
|
|
708
|
+
|
|
709
|
+
if (!isOK) {
|
|
710
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
let val = this.paramData.val;
|
|
714
|
+
|
|
715
|
+
if (this.paramData.keyType == '常量') {
|
|
716
|
+
let len = this.paramData.val.length;
|
|
717
|
+
val = this.paramData.val.padStart(len + 1, '[').padEnd(len + 2, ']');
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (this.paramData.source) {
|
|
721
|
+
this.paramData.source.code = this.paramData.code;
|
|
722
|
+
this.paramData.source.val = val;
|
|
723
|
+
this.paramData.source.type = this.paramData.keyType;
|
|
724
|
+
} else {
|
|
725
|
+
this.params.push({
|
|
726
|
+
code: this.paramData.code,
|
|
727
|
+
val: val,
|
|
728
|
+
type: this.paramData.keyType
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
this.paramItemOpened = false;
|
|
732
|
+
this.$refs.paramItemForm.resetFields();
|
|
733
|
+
},
|
|
734
|
+
paramItemClose() {
|
|
735
|
+
this.paramItemOpened = false;
|
|
736
|
+
this.$refs.paramItemForm.resetFields();
|
|
737
|
+
},
|
|
738
|
+
keyTypeChange() {
|
|
739
|
+
setTimeout(() => {
|
|
740
|
+
this.paramData.val = null;
|
|
741
|
+
//this.$forceUpdate();
|
|
742
|
+
});
|
|
743
|
+
},
|
|
744
|
+
// 保存参数
|
|
745
|
+
paramSave() {
|
|
746
|
+
let obj = {};
|
|
747
|
+
this.params.forEach(item => {
|
|
748
|
+
obj[item.code] = item.val;
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
this.data.param = this.params.length > 0 ? JSON.stringify(obj) : '';
|
|
752
|
+
this.paramOpened = false;
|
|
753
|
+
},
|
|
754
|
+
// 编辑参数项
|
|
755
|
+
paramEdit(row) {
|
|
756
|
+
if (row) {
|
|
757
|
+
this.paramData = {
|
|
758
|
+
code: row.code,
|
|
759
|
+
val: row.val.replace('[', '').replace(']', ''),
|
|
760
|
+
keyType: row.type,
|
|
761
|
+
source: row
|
|
762
|
+
};
|
|
763
|
+
} else {
|
|
764
|
+
this.paramData = {
|
|
765
|
+
code: '',
|
|
766
|
+
val: '',
|
|
767
|
+
keyType: '常量'
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
this.paramItemOpened = true;
|
|
771
|
+
},
|
|
772
|
+
// 上移参数项
|
|
773
|
+
upParam(row, index) {
|
|
774
|
+
if (index > 0) {
|
|
775
|
+
this.params.splice(index, 1);
|
|
776
|
+
this.params.splice(index - 1, 0, row);
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
// 下移参数项
|
|
780
|
+
downParam(row, index) {
|
|
781
|
+
if (index < this.params.length - 1) {
|
|
782
|
+
this.params.splice(index, 1);
|
|
783
|
+
this.params.splice(index + 1, 0, row);
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
// 删除参数项
|
|
787
|
+
paramRemove(row, index) {
|
|
788
|
+
this.params.splice(index, 1);
|
|
789
|
+
},
|
|
790
|
+
// 打开字段选择界面
|
|
791
|
+
openSelect() {
|
|
792
|
+
this.$refs.columnCheck.open(this.data.dataView.model, checked => {
|
|
793
|
+
this.data.code = checked.code;
|
|
794
|
+
this.data.name = checked.name;
|
|
795
|
+
this.data.dataType = checked.dataType;
|
|
796
|
+
|
|
797
|
+
if (checked.objColumn) {
|
|
798
|
+
this.data.source =
|
|
799
|
+
this.data.controlType == 'DialogSelect' || this.data.controlType == 'MultiDialogSelect' ? checked.objColumn.dataType + 'Select' : checked.objColumn.dataType;
|
|
800
|
+
this.data.sourceDataCode = 'id';
|
|
801
|
+
this.data.sourceModel = checked.objColumn.dataType;
|
|
802
|
+
this.data.sourceDisplayCode = checked.objColumn.columns.some(column => {
|
|
803
|
+
return column.code === checked.objColumn.code + '.name';
|
|
804
|
+
})
|
|
805
|
+
? 'name'
|
|
806
|
+
: null;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
setTimeout(() => {
|
|
810
|
+
//this.$forceUpdate();
|
|
811
|
+
});
|
|
812
|
+
});
|
|
813
|
+
},
|
|
814
|
+
// 是否虚拟字段变化
|
|
815
|
+
isVirtualChange($event) {
|
|
816
|
+
this.data.isVirtual = $event;
|
|
817
|
+
//this.$forceUpdate();
|
|
818
|
+
},
|
|
819
|
+
// 表格存储方式变化
|
|
820
|
+
tableStoreTypeChange() {
|
|
821
|
+
if (this.data.tableStoreType == 'Outer') {
|
|
822
|
+
this.data.isVirtual = true;
|
|
823
|
+
//this.$forceUpdate();
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
// 是否显示选择框
|
|
827
|
+
showCheck(json) {
|
|
828
|
+
if (!(json || '').trim()) {
|
|
829
|
+
return true;
|
|
830
|
+
} else {
|
|
831
|
+
let setting = JSON.parse(json);
|
|
832
|
+
|
|
833
|
+
return setting.type == 'True' || setting.type == 'False';
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
// 选择框变化
|
|
837
|
+
checkChange(jsonKey, checkKey) {
|
|
838
|
+
if (!!(this.data[jsonKey] || '').trim()) {
|
|
839
|
+
let setting = JSON.parse(this.data[jsonKey]);
|
|
840
|
+
if (this.data[checkKey]) {
|
|
841
|
+
setting.type = 'True';
|
|
842
|
+
} else {
|
|
843
|
+
setting.type = 'False';
|
|
844
|
+
}
|
|
845
|
+
this.data[jsonKey] = JSON.stringify(setting);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
</script>
|