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.
Files changed (283) hide show
  1. package/.env +5 -0
  2. package/.env.development +0 -0
  3. package/.env.production +0 -0
  4. package/.eslintignore +11 -0
  5. package/.eslintrc.js +47 -0
  6. package/.prettierrc +15 -0
  7. package/README.md +18 -0
  8. package/dist/favicon.ico +0 -0
  9. package/dist/mooho-base-admin-plus.min.esm.js +131746 -0
  10. package/dist/mooho-base-admin-plus.min.js +279 -0
  11. package/dist/setting.js +31 -0
  12. package/dist/static/images/app-barcode.png +0 -0
  13. package/dist/static/images/login/bg.png +0 -0
  14. package/dist/static/images/login/logo.png +0 -0
  15. package/dist/static/images/login/password-active.png +0 -0
  16. package/dist/static/images/login/password-default.png +0 -0
  17. package/dist/static/images/login/signIn-img.png +0 -0
  18. package/dist/static/images/login/user-active.png +0 -0
  19. package/dist/static/images/login/user-default.png +0 -0
  20. package/dist/static/images/logo-dark.png +0 -0
  21. package/dist/static/images/logo-small.png +0 -0
  22. package/dist/static/images/logo.png +0 -0
  23. package/dist/static/images/logo.svg +510 -0
  24. package/dist/static/images/no-image.png +0 -0
  25. package/dist/style.css +4 -0
  26. package/index.html +18 -0
  27. package/other/pda.vue +28 -0
  28. package/package.json +59 -0
  29. package/public/favicon.ico +0 -0
  30. package/public/setting.js +31 -0
  31. package/public/static/images/app-barcode.png +0 -0
  32. package/public/static/images/login/bg.png +0 -0
  33. package/public/static/images/login/logo.png +0 -0
  34. package/public/static/images/login/password-active.png +0 -0
  35. package/public/static/images/login/password-default.png +0 -0
  36. package/public/static/images/login/signIn-img.png +0 -0
  37. package/public/static/images/login/user-active.png +0 -0
  38. package/public/static/images/login/user-default.png +0 -0
  39. package/public/static/images/logo-dark.png +0 -0
  40. package/public/static/images/logo-small.png +0 -0
  41. package/public/static/images/logo.png +0 -0
  42. package/public/static/images/logo.svg +510 -0
  43. package/public/static/images/no-image.png +0 -0
  44. package/src/App.vue +60 -0
  45. package/src/api/application.js +35 -0
  46. package/src/api/customModel.js +187 -0
  47. package/src/api/customPage.js +15 -0
  48. package/src/api/customTable.js +24 -0
  49. package/src/api/dataSource.js +93 -0
  50. package/src/api/dataView.js +199 -0
  51. package/src/api/dictType.js +23 -0
  52. package/src/api/entityView.js +13 -0
  53. package/src/api/enum.js +15 -0
  54. package/src/api/filterColumn.js +16 -0
  55. package/src/api/model.js +244 -0
  56. package/src/api/movePlan.js +29 -0
  57. package/src/api/notification.js +28 -0
  58. package/src/api/openApiPermission.js +25 -0
  59. package/src/api/permission.js +51 -0
  60. package/src/api/planJob.js +15 -0
  61. package/src/api/process.js +23 -0
  62. package/src/api/processDef.js +36 -0
  63. package/src/api/processInst.js +16 -0
  64. package/src/api/rolePermission.js +17 -0
  65. package/src/api/roleProperty.js +36 -0
  66. package/src/api/shortcut.js +20 -0
  67. package/src/api/system.js +23 -0
  68. package/src/api/task.js +56 -0
  69. package/src/api/taskQueue.js +24 -0
  70. package/src/api/user.js +45 -0
  71. package/src/api/viewColumn.js +16 -0
  72. package/src/assets/svg/body.svg +17 -0
  73. package/src/assets/svg/header-theme-dark.svg +40 -0
  74. package/src/assets/svg/header-theme-primary.svg +40 -0
  75. package/src/assets/svg/header-top.svg +40 -0
  76. package/src/assets/svg/icon-happy.svg +1 -0
  77. package/src/assets/svg/icon-sad.svg +1 -0
  78. package/src/assets/svg/icon-social-bilibili.svg +1 -0
  79. package/src/assets/svg/icon-social-dingding.svg +1 -0
  80. package/src/assets/svg/icon-social-facebook.svg +1 -0
  81. package/src/assets/svg/icon-social-juejin.svg +1 -0
  82. package/src/assets/svg/icon-social-qq.svg +1 -0
  83. package/src/assets/svg/icon-social-twitter.svg +1 -0
  84. package/src/assets/svg/icon-social-wechat.svg +1 -0
  85. package/src/assets/svg/icon-social-weibo.svg +1 -0
  86. package/src/assets/svg/icon-social-zhihu.svg +1 -0
  87. package/src/assets/svg/nav-theme-dark.svg +40 -0
  88. package/src/assets/svg/nav-theme-light.svg +40 -0
  89. package/src/components/copyright/index.vue +28 -0
  90. package/src/components/home/notice-list.vue +62 -0
  91. package/src/components/home/shortcut.vue +125 -0
  92. package/src/components/input/dialog-select.vue +301 -0
  93. package/src/components/input/item-select.vue +195 -0
  94. package/src/components/link/index.vue +54 -0
  95. package/src/components/richEditor/index.vue +86 -0
  96. package/src/components/upload/file-upload.vue +84 -0
  97. package/src/components/upload/upload-attachment.vue +119 -0
  98. package/src/components/upload/upload-image.vue +212 -0
  99. package/src/components/view/column-check.vue +223 -0
  100. package/src/components/view/column-edit.vue +850 -0
  101. package/src/components/view/column-select.vue +206 -0
  102. package/src/components/view/condition-edit.vue +164 -0
  103. package/src/components/view/filter-edit.vue +633 -0
  104. package/src/components/view/filter-setting.vue +126 -0
  105. package/src/components/view/form-setting-layout.vue +375 -0
  106. package/src/components/view/form-setting.vue +247 -0
  107. package/src/components/view/group-column.vue +104 -0
  108. package/src/components/view/group-method.vue +104 -0
  109. package/src/components/view/mixin.js +72 -0
  110. package/src/components/view/modal-form-filter.vue +319 -0
  111. package/src/components/view/modal-form-sort.vue +248 -0
  112. package/src/components/view/modal-form.vue +453 -0
  113. package/src/components/view/modal-table.vue +471 -0
  114. package/src/components/view/table-filter.vue +702 -0
  115. package/src/components/view/table-setting.vue +533 -0
  116. package/src/components/view/view-chart.vue +423 -0
  117. package/src/components/view/view-form-draggable.vue +837 -0
  118. package/src/components/view/view-form.vue +1444 -0
  119. package/src/components/view/view-table.vue +2261 -0
  120. package/src/components/workflow/flow-chart.vue +846 -0
  121. package/src/directive/focus.js +10 -0
  122. package/src/directive/tabHide.js +9 -0
  123. package/src/i18n/index.js +15 -0
  124. package/src/i18n/locale/en-US.js +1 -0
  125. package/src/i18n/locale/lang.js +1 -0
  126. package/src/i18n/locale/zh-CN.js +1 -0
  127. package/src/i18n/locale.js +102 -0
  128. package/src/index.js +222 -0
  129. package/src/layouts/basic-layout/header-breadcrumb/index.vue +122 -0
  130. package/src/layouts/basic-layout/header-collapse/index.vue +44 -0
  131. package/src/layouts/basic-layout/header-fullscreen/index.vue +19 -0
  132. package/src/layouts/basic-layout/header-i18n/index.vue +45 -0
  133. package/src/layouts/basic-layout/header-log/index.vue +41 -0
  134. package/src/layouts/basic-layout/header-logo/index.vue +23 -0
  135. package/src/layouts/basic-layout/header-notice/index.vue +218 -0
  136. package/src/layouts/basic-layout/header-reload/index.vue +21 -0
  137. package/src/layouts/basic-layout/header-search/index.vue +37 -0
  138. package/src/layouts/basic-layout/header-setting/index.vue +219 -0
  139. package/src/layouts/basic-layout/header-user/index.vue +175 -0
  140. package/src/layouts/basic-layout/i18n.js +50 -0
  141. package/src/layouts/basic-layout/index.vue +280 -0
  142. package/src/layouts/basic-layout/menu-head/index.vue +120 -0
  143. package/src/layouts/basic-layout/menu-head/title.vue +48 -0
  144. package/src/layouts/basic-layout/menu-side/index.vue +113 -0
  145. package/src/layouts/basic-layout/menu-side/menu-collapse.vue +76 -0
  146. package/src/layouts/basic-layout/menu-side/menu-item.vue +31 -0
  147. package/src/layouts/basic-layout/menu-side/menu-title.vue +56 -0
  148. package/src/layouts/basic-layout/menu-side/submenu.vue +31 -0
  149. package/src/layouts/basic-layout/mixins/click-item.js +21 -0
  150. package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -0
  151. package/src/layouts/basic-layout/mixins/translate-title.js +11 -0
  152. package/src/layouts/basic-layout/tabs/index.vue +192 -0
  153. package/src/layouts/basic-layout/water-mark/index.vue +29 -0
  154. package/src/libs/lodop/index.js +145 -0
  155. package/src/libs/random_str.js +10 -0
  156. package/src/libs/request/index.js +158 -0
  157. package/src/libs/system/index.js +234 -0
  158. package/src/libs/util.cookies.js +44 -0
  159. package/src/libs/util.db.js +13 -0
  160. package/src/libs/util.js +55 -0
  161. package/src/libs/util.log.js +88 -0
  162. package/src/libs/water-mark.js +44 -0
  163. package/src/menu/header.js +20 -0
  164. package/src/menu/modules/dashboard.js +23 -0
  165. package/src/menu/sider.js +12 -0
  166. package/src/mixins/app.js +9 -0
  167. package/src/mixins/page.js +643 -0
  168. package/src/pages/account/login.vue +101 -0
  169. package/src/pages/common/home.vue +169 -0
  170. package/src/pages/common/task-form.vue +350 -0
  171. package/src/pages/common/todo.vue +31 -0
  172. package/src/pages/system/apiLog.vue +79 -0
  173. package/src/pages/system/applicationType.vue +182 -0
  174. package/src/pages/system/customPage.vue +62 -0
  175. package/src/pages/system/customTable.vue +98 -0
  176. package/src/pages/system/dict.vue +36 -0
  177. package/src/pages/system/dictType.vue +58 -0
  178. package/src/pages/system/entityView.vue +38 -0
  179. package/src/pages/system/error/404.vue +6 -0
  180. package/src/pages/system/extendColumn.vue +99 -0
  181. package/src/pages/system/formView.vue +136 -0
  182. package/src/pages/system/log.vue +55 -0
  183. package/src/pages/system/notice.vue +26 -0
  184. package/src/pages/system/openApi.vue +26 -0
  185. package/src/pages/system/openUser.vue +66 -0
  186. package/src/pages/system/organization.vue +98 -0
  187. package/src/pages/system/organizationType.vue +26 -0
  188. package/src/pages/system/permission.vue +175 -0
  189. package/src/pages/system/planJob.vue +40 -0
  190. package/src/pages/system/printTemplate.vue +48 -0
  191. package/src/pages/system/process.vue +79 -0
  192. package/src/pages/system/processType.vue +26 -0
  193. package/src/pages/system/role.vue +395 -0
  194. package/src/pages/system/rolePropertyEdit.vue +480 -0
  195. package/src/pages/system/sequenceSetting.vue +26 -0
  196. package/src/pages/system/systemData.vue +52 -0
  197. package/src/pages/system/tableView.vue +386 -0
  198. package/src/pages/system/taskQueue.vue +48 -0
  199. package/src/pages/system/user.vue +250 -0
  200. package/src/pages/template/processPage.vue +243 -0
  201. package/src/pages/template/reportPage.vue +66 -0
  202. package/src/pages/template/viewPage.vue +139 -0
  203. package/src/plugins/auth/index.js +21 -0
  204. package/src/plugins/error/index.js +31 -0
  205. package/src/plugins/index.js +24 -0
  206. package/src/plugins/sweetalert2/index.js +20 -0
  207. package/src/router/dynamic.js +183 -0
  208. package/src/router/index.js +84 -0
  209. package/src/setting.js +202 -0
  210. package/src/store/index.js +9 -0
  211. package/src/store/modules/admin/index.js +16 -0
  212. package/src/store/modules/admin/modules/account.js +103 -0
  213. package/src/store/modules/admin/modules/cache.js +119 -0
  214. package/src/store/modules/admin/modules/dataView.js +112 -0
  215. package/src/store/modules/admin/modules/db.js +231 -0
  216. package/src/store/modules/admin/modules/i18n.js +87 -0
  217. package/src/store/modules/admin/modules/layout.js +115 -0
  218. package/src/store/modules/admin/modules/loader.js +44 -0
  219. package/src/store/modules/admin/modules/log.js +77 -0
  220. package/src/store/modules/admin/modules/menu.js +338 -0
  221. package/src/store/modules/admin/modules/page.js +466 -0
  222. package/src/store/modules/admin/modules/user.js +96 -0
  223. package/src/store/modules/admin/modules/viewPage.js +34 -0
  224. package/src/styles/common.less +47 -0
  225. package/src/styles/css/default.css +510 -0
  226. package/src/styles/css/login.css +1217 -0
  227. package/src/styles/default/index.less +6 -0
  228. package/src/styles/font/demo.css +539 -0
  229. package/src/styles/font/demo_index.html +372 -0
  230. package/src/styles/font/icon-demo/demo.css +539 -0
  231. package/src/styles/font/icon-demo/demo_index.html +423 -0
  232. package/src/styles/font/icon-demo/iconfont.css +61 -0
  233. package/src/styles/font/icon-demo/iconfont.eot +0 -0
  234. package/src/styles/font/icon-demo/iconfont.js +1 -0
  235. package/src/styles/font/icon-demo/iconfont.svg +59 -0
  236. package/src/styles/font/icon-demo/iconfont.ttf +0 -0
  237. package/src/styles/font/icon-demo/iconfont.woff +0 -0
  238. package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
  239. package/src/styles/font/iconfont.css +47 -0
  240. package/src/styles/font/iconfont.js +1 -0
  241. package/src/styles/font/iconfont.json +65 -0
  242. package/src/styles/font/iconfont.ttf +0 -0
  243. package/src/styles/font/iconfont.woff +0 -0
  244. package/src/styles/font/iconfont.woff2 +0 -0
  245. package/src/styles/font/ionicons.svg +870 -0
  246. package/src/styles/font/ionicons.ttf +0 -0
  247. package/src/styles/font/ionicons.woff +0 -0
  248. package/src/styles/font/ionicons.woff2 +0 -0
  249. package/src/styles/index.less +7 -0
  250. package/src/styles/layout/basic-layout/layout.less +527 -0
  251. package/src/styles/layout/basic-layout/menu.less +274 -0
  252. package/src/styles/layout/index.less +2 -0
  253. package/src/styles/setting.less +6 -0
  254. package/styleguide.config.js +22 -0
  255. package/test/api/barcode.js +50 -0
  256. package/test/api/inbound.js +47 -0
  257. package/test/api/interfaceLog.js +15 -0
  258. package/test/api/interfaceQueue.js +15 -0
  259. package/test/api/interfaceServer.js +29 -0
  260. package/test/api/movePlan.js +50 -0
  261. package/test/api/movePlanItem.js +13 -0
  262. package/test/api/moveType.js +22 -0
  263. package/test/api/openApiPermission.js +25 -0
  264. package/test/api/outbound.js +40 -0
  265. package/test/api/permission.js +34 -0
  266. package/test/api/rolePermission.js +17 -0
  267. package/test/api/user.js +40 -0
  268. package/test/api/viewColumn.js +16 -0
  269. package/test/api/warehouse.js +13 -0
  270. package/test/api/warehouseMoveType.js +18 -0
  271. package/test/main.js +55 -0
  272. package/test/package.js +33 -0
  273. package/test/pages/home/index.vue +22 -0
  274. package/test/pages/task/test.vue +28 -0
  275. package/test/pages/test/dataViewTest.vue +28 -0
  276. package/test/pages/test/logReport.vue +25 -0
  277. package/test/pages/test/testPage.vue +38 -0
  278. package/test/router/routes.js +88 -0
  279. package/test/setting.env.js +22 -0
  280. package/test/styles/css/custom.css +0 -0
  281. package/test/styles/css/login.css +1217 -0
  282. package/vite.config.js +72 -0
  283. package/vue.config.js +20 -0
@@ -0,0 +1,319 @@
1
+ <template>
2
+ <!-- 字段筛选table展示 -->
3
+ <Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" :width="formView.width || '800'">
4
+ <template #header>
5
+ <div>
6
+ <span class="title">筛选字段设置</span>
7
+ <span class="description">Filtering Setting</span>
8
+ </div>
9
+ </template>
10
+
11
+ <div class="i-table-no-border">
12
+ <Table stripe :columns="columnsFiltering" :data="dataFiltering">
13
+ <template #action="{ row, index }">
14
+ <Button size="small" title="编辑" type="primary" ghost custom-icon="fa fa-edit" @click="filteringFmModalopen(row)"></Button>
15
+ <Button size="small" title="上移" type="primary" ghost custom-icon="fa fa-chevron-up" @click="upfiltering(row, index)"></Button>
16
+ <Button size="small" title="下移" type="primary" ghost custom-icon="fa fa-chevron-down" @click="downfiltering(row, index)"></Button>
17
+ <Button size="small" title="移除" type="primary" ghost custom-icon="fa fa-times" @click="removefiltering(row, index)"></Button>
18
+ </template>
19
+ </Table>
20
+ </div>
21
+ <template #footer>
22
+ <Button type="primary" ghost custom-icon="fa fa-plus" @click="filteringFmModalopen(null)">新增</Button>
23
+ <Button type="primary" custom-icon="fa fa-check" @click="SaveFiltering">确定</Button>
24
+ </template>
25
+ <!-- 对筛选条件进行处理 -->
26
+ <Modal v-model="filteringFmModal" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
27
+ <template #header>
28
+ <div>
29
+ <span class="title">添加筛选字段</span>
30
+ <span class="description">sorting add</span>
31
+ </div>
32
+ </template>
33
+ <Form ref="filteringform">
34
+ <Row :gutter="24" type="flex">
35
+ <Col>
36
+ <FormItem label="字段" prop="Code">
37
+ <Input type="text" v-model="data.code">
38
+ <template #prepend>
39
+ <Button custom-icon="fa fa-search" @click="openSelect()"></Button>
40
+ </template>
41
+ </Input>
42
+ </FormItem>
43
+ </Col>
44
+ <Col>
45
+ <FormItem label="操作符" prop="Operator">
46
+ <Select v-model="data.operator" :transfer="true">
47
+ <Option v-for="item in getEnumList('Operator')" :key="item.value" :value="item.id">{{ item.name }}</Option>
48
+ </Select>
49
+ </FormItem>
50
+ </Col>
51
+ <Col>
52
+ <FormItem label="关键词" prop="KeyValue">
53
+ <Input type="text" v-model="data.keyValue" maxlength="200" />
54
+ </FormItem>
55
+ </Col>
56
+ </Row>
57
+ </Form>
58
+ <template #footer>
59
+ <Button type="primary" custom-icon="fa fa-check" @click="saveFilteringForm($event)">确定</Button>
60
+ </template>
61
+ <column-check ref="columnCheck" />
62
+ </Modal>
63
+ </Modal>
64
+ </template>
65
+
66
+ <script>
67
+ import mixinPage from '../../mixins/page';
68
+ import columnCheck from './column-check';
69
+
70
+ export default {
71
+ mixins: [mixinPage],
72
+ components: { columnCheck },
73
+
74
+ props: {
75
+ filter: String, //原表单筛选字段json值
76
+ dataView: {} //原表单对象
77
+ },
78
+ computed: {},
79
+ data() {
80
+ return {
81
+ opened: false,
82
+ formView: {},
83
+ filteringFmModal: false,
84
+ columnsFiltering: [
85
+ {
86
+ type: 'index',
87
+ width: 100,
88
+ title: '序号',
89
+ align: 'center'
90
+ },
91
+ {
92
+ title: '字段',
93
+ key: 'column'
94
+ },
95
+ {
96
+ title: '操作符',
97
+ key: 'operatorType'
98
+ },
99
+ {
100
+ title: '关键词',
101
+ key: 'keyValue'
102
+ },
103
+ {
104
+ title: ' ',
105
+ slot: 'action',
106
+ width: 200,
107
+ fixed: 'right',
108
+ align: 'center'
109
+ }
110
+ ],
111
+ dataFiltering: [],
112
+ data: {}
113
+ };
114
+ },
115
+ methods: {
116
+ open() {
117
+ this.toData();
118
+ this.opened = true;
119
+ },
120
+ close() {
121
+ this.opened = false;
122
+ },
123
+ // 将数据库获取的json字符串转换为数组对象
124
+ toData() {
125
+ let filterArr = [];
126
+ if (this.filter != '' && this.filter != null) {
127
+ let json = JSON.parse(this.filter);
128
+ for (let key in json) {
129
+ let operatorArr = [];
130
+ operatorArr = this.operatorChange(key);
131
+ filterArr.push({
132
+ column: operatorArr[0],
133
+ operatorType: operatorArr[1],
134
+ rule: operatorArr[2],
135
+ operator: operatorArr[3],
136
+ keyValue: json[key]
137
+ });
138
+ }
139
+ }
140
+ this.dataFiltering = filterArr;
141
+ },
142
+ // 操作符数据转换( companyType_g ---> companyType,_g,大于,GreaterThan)
143
+ operatorChange(operator) {
144
+ let operatorArr = new Array(4);
145
+ if (operator.indexOf('_g') >= 0 && operator.indexOf('_ge') == -1) {
146
+ operatorArr[0] = operator.replace('_g', '');
147
+ operatorArr[1] = '大于';
148
+ operatorArr[2] = '_g';
149
+ operatorArr[3] = 'GreaterThan';
150
+ } else if (operator.indexOf('_l') >= 0 && operator.indexOf('_le') == -1) {
151
+ operatorArr[0] = operator.replace('_l', '');
152
+ operatorArr[1] = '小于';
153
+ operatorArr[2] = '_l';
154
+ operatorArr[3] = 'LessThan';
155
+ } else if (operator.indexOf('_ge') >= 0) {
156
+ operatorArr[0] = operator.replace('_ge', '');
157
+ operatorArr[1] = '大于等于';
158
+ operatorArr[2] = '_ge';
159
+ operatorArr[3] = 'GreaterThanOrEqual';
160
+ } else if (operator.indexOf('_le') >= 0) {
161
+ operatorArr[0] = operator.replace('_le', '');
162
+ operatorArr[1] = '小于等于';
163
+ operatorArr[2] = '_le';
164
+ operatorArr[3] = 'LessThanOrEqual';
165
+ } else if (operator.indexOf('_n') >= 0) {
166
+ operatorArr[0] = operator.replace('_n', '');
167
+ operatorArr[1] = '不等于';
168
+ operatorArr[2] = '_n';
169
+ operatorArr[3] = 'NotEqual';
170
+ } else if (operator.indexOf('_c') >= 0) {
171
+ operatorArr[0] = operator;
172
+ operatorArr[1] = '文字包含';
173
+ operatorArr[2] = '_c';
174
+ operatorArr[3] = 'Contains';
175
+ } else {
176
+ operatorArr[0] = operator;
177
+ operatorArr[1] = '等于';
178
+ operatorArr[2] = '';
179
+ operatorArr[3] = 'Equal';
180
+ }
181
+ return operatorArr;
182
+ },
183
+ // 操作符数据转换 ( companyType,_g,大于,GreaterThan ---> companyType_g )
184
+ operatorReChange(operator) {
185
+ let operatorArr = new Array(2);
186
+ if (operator == 'GreaterThan') {
187
+ operatorArr[0] = '大于';
188
+ operatorArr[1] = '_g';
189
+ } else if (operator == 'LessThan') {
190
+ operatorArr[0] = '小于';
191
+ operatorArr[1] = '_l';
192
+ } else if (operator == 'GreaterThanOrEqual') {
193
+ operatorArr[0] = '大于等于';
194
+ operatorArr[1] = '_ge';
195
+ } else if (operator == 'LessThanOrEqual') {
196
+ operatorArr[0] = '小于等于';
197
+ operatorArr[1] = '_le';
198
+ } else if (operator == 'NotEqual') {
199
+ operatorArr[0] = '不等于';
200
+ operatorArr[1] = '_n';
201
+ } else if (operator == 'Contains') {
202
+ operatorArr[0] = '文字包含';
203
+ operatorArr[1] = '_c';
204
+ } else {
205
+ operatorArr[0] = '等于';
206
+ operatorArr[1] = '';
207
+ }
208
+ return operatorArr;
209
+ },
210
+
211
+ // 筛选结果 将table对象转换为json字符串
212
+ toFilteringJson() {
213
+ let jsonStr = '{';
214
+ if (this.dataFiltering.length > 0) {
215
+ for (let key in this.dataFiltering) {
216
+ jsonStr += '"' + this.dataFiltering[key].column + this.dataFiltering[key].rule + '":"' + this.dataFiltering[key].keyValue + '",';
217
+ }
218
+ jsonStr = jsonStr.substring(0, jsonStr.length - 1);
219
+ jsonStr += '}';
220
+ } else {
221
+ jsonStr = '';
222
+ }
223
+ this.$emit('bindFilter', jsonStr);
224
+ this.close();
225
+ },
226
+
227
+ // 打开筛选编辑表单
228
+ filteringFmModalopen(row) {
229
+ // // row = null表示新增
230
+ if (row != null) {
231
+ this.data.code = row.column;
232
+ this.data.operator = row.operator;
233
+ this.data.keyValue = row.keyValue;
234
+ }
235
+ // 表示新增
236
+ else {
237
+ this.data.code = '';
238
+ this.data.rule = '';
239
+ this.data.operator = 'Equal';
240
+ this.data.keyValue = '';
241
+ }
242
+ this.filteringFmModal = true;
243
+ },
244
+
245
+ // 添加筛选字段表单确认
246
+ async saveFilteringForm() {
247
+ if (!!(this.data.code || '').trim() && !!(this.data.keyValue || '').trim() && !!(this.data.operator || '').trim()) {
248
+ let ope = this.operatorReChange(this.data.operator);
249
+ let checkSort = false;
250
+ this.dataFiltering.forEach(item => {
251
+ // 如果编辑列与原数据中有相同列,则做更新不做添加
252
+ if (item.column == this.data.code) {
253
+ checkSort = true;
254
+ (item.operatorType = ope[0]), (item.rule = ope[1]), (item.operator = this.data.operator), (item.keyValue = this.data.keyValue);
255
+ }
256
+ });
257
+ if (!checkSort) {
258
+ this.dataFiltering.push({
259
+ column: this.data.code,
260
+ operatorType: ope[0],
261
+ rule: ope[1],
262
+ operator: this.data.operator,
263
+ keyValue: this.data.keyValue
264
+ });
265
+ }
266
+
267
+ this.filteringFmModal = false;
268
+ } else {
269
+ this.error('字段或筛选关键词不能为空,请正确填写!');
270
+ }
271
+ },
272
+ SaveFiltering() {
273
+ this.toFilteringJson();
274
+ },
275
+
276
+ // 筛选字段的移动操作
277
+ // 移除一行数据
278
+ removefiltering(row, index) {
279
+ if (row != null) {
280
+ this.dataFiltering.splice(index, 1);
281
+ }
282
+ },
283
+ // 上移
284
+ upfiltering(row, index) {
285
+ if (index > 0) {
286
+ this.dataFiltering.splice(index, 1);
287
+ this.dataFiltering.splice(index - 1, 0, row);
288
+ }
289
+ },
290
+ // 下移
291
+ downfiltering(row, index) {
292
+ if (index < this.dataFiltering.length - 1) {
293
+ this.dataFiltering.splice(index, 1);
294
+ this.dataFiltering.splice(index + 1, 0, row);
295
+ }
296
+ },
297
+ // 打开字段选择界面
298
+ openSelect() {
299
+ this.$refs.columnCheck.open(this.dataView.model, checked => {
300
+ this.data.code = checked.code;
301
+ this.data.name = checked.name;
302
+ this.data.dataType = checked.dataType;
303
+ this.data.source = checked.objColumn != null ? checked.objColumn.dataType : null;
304
+ this.data.sourceDataCode = checked.objColumn != null ? 'id' : null;
305
+ this.data.sourceDisplayCode =
306
+ checked.objColumn != null &&
307
+ checked.objColumn.columns.some(function (column) {
308
+ return column.code === checked.objColumn.code + '.name';
309
+ })
310
+ ? 'name'
311
+ : null;
312
+ setTimeout(() => {
313
+ //this.$forceUpdate();
314
+ });
315
+ });
316
+ }
317
+ }
318
+ };
319
+ </script>
@@ -0,0 +1,248 @@
1
+ <template>
2
+ <!-- 字段排序table展示 -->
3
+ <Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" :width="formView.width || '800'">
4
+ <template #header>
5
+ <div>
6
+ <span class="title">排序字段设置</span>
7
+ <span class="description">Sorting Setting</span>
8
+ </div>
9
+ </template>
10
+ <div class="i-table-no-border">
11
+ <Table stripe :columns="columnsSorting" :data="dataSorting">
12
+ <template #action="{ row, index }">
13
+ <Button size="small" title="编辑" type="primary" ghost custom-icon="fa fa-edit" @click="sortingFmModalopen(row)"></Button>
14
+ <Button size="small" title="上移" type="primary" ghost custom-icon="fa fa-chevron-up" @click="upSorting(row, index)"></Button>
15
+ <Button size="small" title="下移" type="primary" ghost custom-icon="fa fa-chevron-down" @click="downSorting(row, index)"></Button>
16
+ <Button size="small" title="移除" type="primary" ghost custom-icon="fa fa-times" @click="removeSorting(row, index)"></Button>
17
+ </template>
18
+ </Table>
19
+ </div>
20
+ <template #footer>
21
+ <Button type="primary" ghost custom-icon="fa fa-plus" @click="sortingFmModalopen(null)">新增</Button>
22
+ <Button type="primary" custom-icon="fa fa-check" @click="SaveSorting">确定</Button>
23
+ </template>
24
+ <!-- 对排序字段进行处理 -->
25
+ <Modal v-model="sortingFmModal" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
26
+ <template #header>
27
+ <div>
28
+ <span class="title">添加排序字段</span>
29
+ <span class="description">sorting add</span>
30
+ </div>
31
+ </template>
32
+ <Form ref="sortingform">
33
+ <Row :gutter="24" type="flex">
34
+ <Col>
35
+ <FormItem label="字段" prop="Code">
36
+ <Input type="text" readonly v-model="data.code" @on-focus="openSelect()">
37
+ <template #prepend>
38
+ <Button custom-icon="fa fa-search" @click="openSelect()"></Button>
39
+ </template>
40
+ </Input>
41
+ </FormItem>
42
+ </Col>
43
+ <Col>
44
+ <FormItem label="操作符" prop="SortingRule">
45
+ <Select v-model="data.rule" :transfer="true">
46
+ <Option v-for="item in sortingList" :value="item.value" :key="item.value">{{ item.label }}</Option>
47
+ </Select>
48
+ </FormItem>
49
+ </Col>
50
+ </Row>
51
+ </Form>
52
+ <template #footer>
53
+ <Button type="primary" custom-icon="fa fa-check" @click="saveSortingForm($event)">确定</Button>
54
+ </template>
55
+ </Modal>
56
+ <column-check ref="columnCheck" />
57
+ </Modal>
58
+ </template>
59
+
60
+ <script>
61
+ import mixinPage from '../../mixins/page';
62
+ import columnCheck from './column-check';
63
+
64
+ export default {
65
+ mixins: [mixinPage],
66
+ components: { columnCheck },
67
+ props: {
68
+ sort: String, //原排序字段json值
69
+ dataView: {} //原表单对象
70
+ },
71
+ computed: {},
72
+ data() {
73
+ return {
74
+ opened: false,
75
+ formView: {},
76
+ sortingFmModal: false,
77
+ columnsSorting: [
78
+ {
79
+ type: 'index',
80
+ width: 100,
81
+ title: '序号',
82
+ align: 'center'
83
+ },
84
+ {
85
+ title: '字段',
86
+ key: 'column'
87
+ },
88
+ {
89
+ title: '规则',
90
+ key: 'rule'
91
+ },
92
+ {
93
+ title: ' ',
94
+ slot: 'action',
95
+ width: 200,
96
+ fixed: 'right',
97
+ align: 'center'
98
+ }
99
+ ],
100
+ dataSorting: [],
101
+ sortingList: [
102
+ {
103
+ value: 'asc',
104
+ label: '升序(从小到大)'
105
+ },
106
+ {
107
+ value: 'desc',
108
+ label: '降序(从大到小)'
109
+ }
110
+ ],
111
+ data: {}
112
+ };
113
+ },
114
+ async created() {},
115
+ methods: {
116
+ open() {
117
+ this.toData();
118
+ this.opened = true;
119
+ },
120
+ close() {
121
+ this.opened = false;
122
+ },
123
+ // 打开排序字段设置表单
124
+ sortingFmModalopen(row) {
125
+ // row = null表示新增
126
+ if (row != null) {
127
+ this.data.code = row.column;
128
+ this.data.rule = row.rule;
129
+ }
130
+ // 表示新增
131
+ else {
132
+ this.data.code = '';
133
+ this.data.rule = '';
134
+ }
135
+ this.sortingFmModal = true;
136
+ },
137
+ // 将数据库获取的json字符串转换为数组对象
138
+ toData() {
139
+ let array = [];
140
+ // 如果该字段为空,则如下转换不进行
141
+ if (this.sort != '' && this.sort != null) {
142
+ let json = JSON.parse(this.sort);
143
+ for (let key in json) {
144
+ array.push({
145
+ column: key,
146
+ rule: json[key]
147
+ });
148
+ }
149
+ }
150
+ this.dataSorting = array;
151
+ },
152
+ // 添加排序规则确认
153
+ async saveSortingForm() {
154
+ // 保存前字段均不为空
155
+ if (this.data.code != '' && this.data.code != null && this.data.rule != null && this.data.rule != '') {
156
+ let checkSort = false;
157
+ // 遍历原排序对象 dataSorting 中是否有与新增的字段相同的
158
+ // 暂时不做此判断,后续再优化2021年3月19日18:39:13
159
+ // this.dataSorting.forEach(item => {
160
+ // if (item.column == this.data.code) {
161
+ // checkSort = true;
162
+ // }
163
+ // });
164
+ this.dataSorting.forEach(item => {
165
+ // 如果编辑列与原数据中有相同列,则做更新不做添加
166
+ if (item.column == this.data.code) {
167
+ checkSort = true;
168
+ item.rule = this.data.rule;
169
+ }
170
+ });
171
+ if (!checkSort) {
172
+ // 将新加的字段对象添加到原排序对象 dataSorting 中
173
+ this.dataSorting.push({
174
+ column: this.data.code,
175
+ rule: this.data.rule
176
+ });
177
+ }
178
+ // 确认后关闭modal
179
+ this.sortingFmModal = false;
180
+ } else {
181
+ this.error('字段或排序规则不能为空,请正确填写!');
182
+ }
183
+ },
184
+ // 添加排序字段table确认
185
+ SaveSorting() {
186
+ this.toSortingJson();
187
+ },
188
+ // 排序数据的移动操作
189
+ // 移除一行数据
190
+ removeSorting(row, index) {
191
+ if (row != null) {
192
+ this.dataSorting.splice(index, 1);
193
+ }
194
+ },
195
+ // 上移
196
+ upSorting(row, index) {
197
+ if (index > 0) {
198
+ this.dataSorting.splice(index, 1);
199
+ this.dataSorting.splice(index - 1, 0, row);
200
+ }
201
+ },
202
+ // 下移
203
+ downSorting(row, index) {
204
+ if (index < this.dataSorting.length - 1) {
205
+ this.dataSorting.splice(index, 1);
206
+ this.dataSorting.splice(index + 1, 0, row);
207
+ }
208
+ },
209
+ // 打开字段选择界面
210
+ openSelect() {
211
+ this.$refs.columnCheck.open(this.dataView.model, checked => {
212
+ this.data.code = checked.code;
213
+ this.data.name = checked.name;
214
+ this.data.dataType = checked.dataType;
215
+ this.data.source = checked.objColumn != null ? checked.objColumn.dataType : null;
216
+ this.data.sourceDataCode = checked.objColumn != null ? 'id' : null;
217
+ this.data.sourceDisplayCode =
218
+ checked.objColumn != null &&
219
+ checked.objColumn.columns.some(function (column) {
220
+ return column.code === checked.objColumn.code + '.name';
221
+ })
222
+ ? 'name'
223
+ : null;
224
+ setTimeout(() => {
225
+ //this.$forceUpdate();
226
+ });
227
+ });
228
+ },
229
+ //[{column: 'type.orderNo',rule: 'asc'},{column: 'orderNo',rule: 'asc'}]
230
+ // { "type.orderNo": "asc", "orderNo": "asc" }
231
+ // 排序结果 将table对象转换为json字符串
232
+ toSortingJson() {
233
+ let jsonStr = '{';
234
+ if (this.dataSorting.length > 0) {
235
+ for (let key in this.dataSorting) {
236
+ jsonStr += '"' + this.dataSorting[key].column + '":"' + this.dataSorting[key].rule + '",';
237
+ }
238
+ jsonStr = jsonStr.substring(0, jsonStr.length - 1);
239
+ jsonStr += '}';
240
+ } else {
241
+ jsonStr = '';
242
+ }
243
+ this.$emit('bindSort', jsonStr);
244
+ this.close();
245
+ }
246
+ }
247
+ };
248
+ </script>