super-pages 0.0.21-up → 0.0.22-up

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.
@@ -1,135 +1,135 @@
1
- <template>
2
- <div>
3
- <template
4
- v-if="
5
- pageSettingList &&
6
- pageSettingList !== null &&
7
- pageSettingList.length > 0
8
- "
9
- >
10
- <el-row v-for="(row, rowIndex) in pageSettingList" :key="rowIndex">
11
- <template v-for="(col, colIndex) in row.colList" :key="colIndex">
12
- <el-col
13
- :span="
14
- col.options && col.options.colWidth ? col.options.colWidth : 24
15
- "
16
- :class="{
17
- placeholder:
18
- col.baseSetting.type === 'placeholder' ||
19
- col.baseSetting.type === 'enter',
20
- }"
21
- >
22
- <sub-tab-page
23
- v-if="col.baseSetting.type === 'tab'"
24
- :col-setting="col"
25
- :workflow-id="workflowId"
26
- :data-id="dataId"
27
- :task-id="taskId"
28
- :page-code="pageCode"
29
- :chart-query-setting="chartQuerySetting"
30
- @export="exportReport"
31
- @update-value="updateValues"
32
- />
33
- <widget-col-page
34
- v-else
35
- :col="col"
36
- :data-id="dataId"
37
- :workflow-id="workflowId"
38
- :task-id="taskId"
39
- :page-code="pageCode"
40
- :tab-code="tabCode"
41
- :field-permissions="fieldPermissions"
42
- :chart-query-setting="chartQuerySetting"
43
- @update-value="updateValues"
44
- @prohibi-edit="fnProhibitToEdit"
45
- @export="exportReport"
46
- />
47
- </el-col>
48
- </template>
49
- </el-row>
50
- </template>
51
- </div>
52
- </template>
53
-
54
- <script>
55
- import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
56
- import SubTabPage from './sub-tab-page'
57
- import WidgetColPage from './widget-col-page'
58
- import { getStoreInfo } from './util/common-util'
59
- export default {
60
- name: 'WidgetTabPage',
61
- components: {
62
- SubTabPage,
63
- WidgetColPage,
64
- },
65
- props: {
66
- // 页面编码
67
- pageCode: {
68
- type: String,
69
- default: null,
70
- },
71
- // 表单页面修改记录时记录id
72
- dataId: {
73
- type: Number,
74
- default: null,
75
- },
76
- // 流程表单页面办理任务时任务id
77
- taskId: {
78
- type: Number,
79
- default: null,
80
- },
81
- // 1个页签的内容配置
82
- oneTabContent: {
83
- type: Array,
84
- default: null,
85
- },
86
- // 流程实例id
87
- workflowId: {
88
- type: Number,
89
- default: null,
90
- },
91
- // 页签编码
92
- tabCode: {
93
- type: String,
94
- default: null,
95
- },
96
- // 图表查询组件配置col
97
- chartQuerySetting: {
98
- type: Object,
99
- default: null,
100
- },
101
- },
102
- data() {
103
- const system = getStoreInfo(this.pageCode, '_systemInfo')
104
- return {
105
- pageSettingList: [],
106
- system,
107
- fieldPermissions: {},
108
- }
109
- },
110
- created() {
111
- if (this.oneTabContent) {
112
- // 表示是页签页面
113
- this.pageSettingList = this.oneTabContent
114
- }
115
- },
116
- methods: {
117
- updateValues(sourceModel, sourceTableName, targetRowIndex) {
118
- $emit(this, 'update-value', sourceModel, sourceTableName, targetRowIndex)
119
- },
120
- fnProhibitToEdit(entity) {
121
- this.entity = entity
122
- },
123
- // chartQuery组件,导出报告
124
- exportReport(beanName) {
125
- // 向父页面传递
126
- $emit(this, 'export', beanName)
127
- },
128
- },
129
- emits: ['update-value', 'export'],
130
- }
131
- </script>
132
-
133
- <style lang="scss" scoped>
134
- @import '../../../src/styles/index';
135
- </style>
1
+ <template>
2
+ <div>
3
+ <template
4
+ v-if="
5
+ pageSettingList &&
6
+ pageSettingList !== null &&
7
+ pageSettingList.length > 0
8
+ "
9
+ >
10
+ <el-row v-for="(row, rowIndex) in pageSettingList" :key="rowIndex">
11
+ <template v-for="(col, colIndex) in row.colList" :key="colIndex">
12
+ <el-col
13
+ :span="
14
+ col.options && col.options.colWidth ? col.options.colWidth : 24
15
+ "
16
+ :class="{
17
+ placeholder:
18
+ col.baseSetting.type === 'placeholder' ||
19
+ col.baseSetting.type === 'enter',
20
+ }"
21
+ >
22
+ <sub-tab-page
23
+ v-if="col.baseSetting.type === 'tab'"
24
+ :col-setting="col"
25
+ :workflow-id="workflowId"
26
+ :data-id="dataId"
27
+ :task-id="taskId"
28
+ :page-code="pageCode"
29
+ :chart-query-setting="chartQuerySetting"
30
+ @export="exportReport"
31
+ @update-value="updateValues"
32
+ />
33
+ <widget-col-page
34
+ v-else
35
+ :col="col"
36
+ :data-id="dataId"
37
+ :workflow-id="workflowId"
38
+ :task-id="taskId"
39
+ :page-code="pageCode"
40
+ :tab-code="tabCode"
41
+ :field-permissions="fieldPermissions"
42
+ :chart-query-setting="chartQuerySetting"
43
+ @update-value="updateValues"
44
+ @prohibi-edit="fnProhibitToEdit"
45
+ @export="exportReport"
46
+ />
47
+ </el-col>
48
+ </template>
49
+ </el-row>
50
+ </template>
51
+ </div>
52
+ </template>
53
+
54
+ <script>
55
+ import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
56
+ import SubTabPage from './sub-tab-page'
57
+ import WidgetColPage from './widget-col-page'
58
+ import { getStoreInfo } from './util/common-util'
59
+ export default {
60
+ name: 'WidgetTabPage',
61
+ components: {
62
+ SubTabPage,
63
+ WidgetColPage,
64
+ },
65
+ props: {
66
+ // 页面编码
67
+ pageCode: {
68
+ type: String,
69
+ default: null,
70
+ },
71
+ // 表单页面修改记录时记录id
72
+ dataId: {
73
+ type: Number,
74
+ default: null,
75
+ },
76
+ // 流程表单页面办理任务时任务id
77
+ taskId: {
78
+ type: Number,
79
+ default: null,
80
+ },
81
+ // 1个页签的内容配置
82
+ oneTabContent: {
83
+ type: Array,
84
+ default: null,
85
+ },
86
+ // 流程实例id
87
+ workflowId: {
88
+ type: Number,
89
+ default: null,
90
+ },
91
+ // 页签编码
92
+ tabCode: {
93
+ type: String,
94
+ default: null,
95
+ },
96
+ // 图表查询组件配置col
97
+ chartQuerySetting: {
98
+ type: Object,
99
+ default: null,
100
+ },
101
+ },
102
+ data() {
103
+ const system = getStoreInfo(this.pageCode, '_systemInfo')
104
+ return {
105
+ pageSettingList: [],
106
+ system,
107
+ fieldPermissions: {},
108
+ }
109
+ },
110
+ created() {
111
+ if (this.oneTabContent) {
112
+ // 表示是页签页面
113
+ this.pageSettingList = this.oneTabContent
114
+ }
115
+ },
116
+ methods: {
117
+ updateValues(sourceModel, sourceTableName, targetRowIndex) {
118
+ $emit(this, 'update-value', sourceModel, sourceTableName, targetRowIndex)
119
+ },
120
+ fnProhibitToEdit(entity) {
121
+ this.entity = entity
122
+ },
123
+ // chartQuery组件,导出报告
124
+ exportReport(beanName) {
125
+ // 向父页面传递
126
+ $emit(this, 'export', beanName)
127
+ },
128
+ },
129
+ emits: ['update-value', 'export'],
130
+ }
131
+ </script>
132
+
133
+ <style lang="scss" scoped>
134
+ @import '../../../src/styles/index';
135
+ </style>
@@ -1,9 +1,9 @@
1
- // 本文件用来导出单个组件
2
- import SuperPageDialog from './src/super-page-dialog.vue'
3
-
4
- // 每个组件都提供了install方法,这样就可以按需引入单个组件
5
- SuperPageDialog.install = function (Vue) {
6
- window.$vueApp.component(SuperPageDialog.name, SuperPageDialog)
7
- }
8
-
9
- export default SuperPageDialog
1
+ // 本文件用来导出单个组件
2
+ import SuperPageDialog from './src/super-page-dialog.vue'
3
+
4
+ // 每个组件都提供了install方法,这样就可以按需引入单个组件
5
+ SuperPageDialog.install = function (Vue) {
6
+ window.$vueApp.component(SuperPageDialog.name, SuperPageDialog)
7
+ }
8
+
9
+ export default SuperPageDialog
@@ -1,59 +1,59 @@
1
- const eventRegistryMap = new WeakMap()
2
- function getRegistry(instance) {
3
- let events = eventRegistryMap.get(instance)
4
- if (!events) {
5
- eventRegistryMap.set(instance, (events = Object.create(null)))
6
- }
7
- return events
8
- }
9
- export function $on(instance, event, fn) {
10
- if (Array.isArray(event)) {
11
- event.forEach((e) => $on(instance, e, fn))
12
- } else {
13
- const events = getRegistry(instance)
14
- ;(events[event] || (events[event] = [])).push(fn)
15
- }
16
- return instance
17
- }
18
- export function $once(instance, event, fn) {
19
- const wrapped = (...args) => {
20
- $off(instance, event, wrapped)
21
- fn.call(instance, ...args)
22
- }
23
- wrapped.fn = fn
24
- $on(instance, event, wrapped)
25
- return instance
26
- }
27
- export function $off(instance, event, fn) {
28
- const vm = instance
29
- // all
30
- if (!event) {
31
- eventRegistryMap.set(instance, Object.create(null))
32
- return vm
33
- }
34
- // array of events
35
- if (Array.isArray(event)) {
36
- event.forEach((e) => $off(instance, e, fn))
37
- return vm
38
- }
39
- // specific event
40
- const events = getRegistry(instance)
41
- const cbs = events[event]
42
- if (!cbs) {
43
- return vm
44
- }
45
- if (!fn) {
46
- events[event] = undefined
47
- return vm
48
- }
49
- events[event] = cbs.filter((cb) => !(cb === fn || cb.fn === fn))
50
- return vm
51
- }
52
- export function $emit(instance, event, ...args) {
53
- instance && instance.$emit && instance.$emit(event, ...args)
54
- const cbs = getRegistry(instance)[event]
55
- if (cbs) {
56
- cbs.map((cb) => cb.apply(instance, args))
57
- }
58
- return instance
59
- }
1
+ const eventRegistryMap = new WeakMap()
2
+ function getRegistry(instance) {
3
+ let events = eventRegistryMap.get(instance)
4
+ if (!events) {
5
+ eventRegistryMap.set(instance, (events = Object.create(null)))
6
+ }
7
+ return events
8
+ }
9
+ export function $on(instance, event, fn) {
10
+ if (Array.isArray(event)) {
11
+ event.forEach((e) => $on(instance, e, fn))
12
+ } else {
13
+ const events = getRegistry(instance)
14
+ ;(events[event] || (events[event] = [])).push(fn)
15
+ }
16
+ return instance
17
+ }
18
+ export function $once(instance, event, fn) {
19
+ const wrapped = (...args) => {
20
+ $off(instance, event, wrapped)
21
+ fn.call(instance, ...args)
22
+ }
23
+ wrapped.fn = fn
24
+ $on(instance, event, wrapped)
25
+ return instance
26
+ }
27
+ export function $off(instance, event, fn) {
28
+ const vm = instance
29
+ // all
30
+ if (!event) {
31
+ eventRegistryMap.set(instance, Object.create(null))
32
+ return vm
33
+ }
34
+ // array of events
35
+ if (Array.isArray(event)) {
36
+ event.forEach((e) => $off(instance, e, fn))
37
+ return vm
38
+ }
39
+ // specific event
40
+ const events = getRegistry(instance)
41
+ const cbs = events[event]
42
+ if (!cbs) {
43
+ return vm
44
+ }
45
+ if (!fn) {
46
+ events[event] = undefined
47
+ return vm
48
+ }
49
+ events[event] = cbs.filter((cb) => !(cb === fn || cb.fn === fn))
50
+ return vm
51
+ }
52
+ export function $emit(instance, event, ...args) {
53
+ instance && instance.$emit && instance.$emit(event, ...args)
54
+ const cbs = getRegistry(instance)[event]
55
+ if (cbs) {
56
+ cbs.map((cb) => cb.apply(instance, args))
57
+ }
58
+ return instance
59
+ }
@@ -1,9 +1,9 @@
1
- import i18n from '../i18n/i18n'
2
- export function getI18n() {
3
- if (!window.$locale) {
4
- i18n.locale = 'cn'
5
- } else {
6
- i18n.locale = window.$locale
7
- }
8
- return i18n.global
9
- }
1
+ import i18n from '../i18n/i18n'
2
+ export function getI18n() {
3
+ if (!window.$locale) {
4
+ i18n.locale = 'cn'
5
+ } else {
6
+ i18n.locale = window.$locale
7
+ }
8
+ return i18n.global
9
+ }
package/vite.config.js CHANGED
@@ -1,36 +1,36 @@
1
- import { defineConfig } from "vite";
2
- import vue from "@vitejs/plugin-vue";
3
- import path from "path";
4
- // https://vitejs.dev/config/
5
- export default defineConfig({
6
- plugins: [vue()],
7
- build: {
8
- outDir: "lib", //输出文件名称
9
- lib: {
10
- entry: path.resolve(__dirname, "./packages/index.js"), //指定组件编译入口文件
11
- name: "super-pages", // 打包js 名称
12
- fileName: "super-pages",
13
- }, //库编译模式配置
14
- rollupOptions: {
15
- // 确保外部化处理那些你不想打包进库的依赖
16
- external: ["vue"],
17
- output: {
18
- // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
19
- globals: {
20
- vue: "Vue",
21
- },
22
- // 定义生成css的名称
23
- assetFileNames: (assetInfo) => {
24
- if (assetInfo.name == 'style.css')
25
- return 'super-pages.css'; // 打包的css名称
26
- return assetInfo.name;
27
- },
28
- },
29
- }, // rollup打包配置
30
- },
31
- // ...其他配置项
32
- resolve: {
33
- // 忽略后缀名的配置选项, 添加 .vue 选项时要记得原本默认忽略的选项也要手动写入
34
- extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
35
- }
36
- });
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue";
3
+ import path from "path";
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ build: {
8
+ outDir: "lib", //输出文件名称
9
+ lib: {
10
+ entry: path.resolve(__dirname, "./packages/index.js"), //指定组件编译入口文件
11
+ name: "super-pages", // 打包js 名称
12
+ fileName: "super-pages",
13
+ }, //库编译模式配置
14
+ rollupOptions: {
15
+ // 确保外部化处理那些你不想打包进库的依赖
16
+ external: ["vue"],
17
+ output: {
18
+ // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
19
+ globals: {
20
+ vue: "Vue",
21
+ },
22
+ // 定义生成css的名称
23
+ assetFileNames: (assetInfo) => {
24
+ if (assetInfo.name == 'style.css')
25
+ return 'super-pages.css'; // 打包的css名称
26
+ return assetInfo.name;
27
+ },
28
+ },
29
+ }, // rollup打包配置
30
+ },
31
+ // ...其他配置项
32
+ resolve: {
33
+ // 忽略后缀名的配置选项, 添加 .vue 选项时要记得原本默认忽略的选项也要手动写入
34
+ extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
35
+ }
36
+ });