sh-view 2.6.4 → 2.6.5

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/README.md CHANGED
@@ -1,39 +1,85 @@
1
1
  # sh-view
2
2
 
3
3
  #### 介绍
4
- {**以下是 Gitee 平台说明,您可以替换此简介**
5
- Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
6
- 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
4
+ 1. 基于vxe-table扩展,功能更强大,配置更便捷,内置18种渲染器,灵活配置,足以满足您的业务需求!
5
+ 2. 完全兼容vxe-table原有组件及功能,完全可以自主扩展更多的自定义组件
7
6
 
8
- #### 软件架构
9
- 软件架构说明
7
+ #### 组件
8
+ 自封装组件,不依赖其他ui框架
9
+ 1. 默认全局安装:
10
+ ShAlert,
11
+ ShBadge,
12
+ ShCard,
13
+ ShCodeEditor,
14
+ ShCol,
15
+ ShCorner,
16
+ ShCountTo,
17
+ ShDrawer,
18
+ ShEmpty,
19
+ ShForm,
20
+ ShHeader,
21
+ ShIcon,
22
+ ShImage,
23
+ ShList,
24
+ ShLoading,
25
+ ShModal,
26
+ ShNoticebar,
27
+ ShPoptip,
28
+ ShProgress,
29
+ ShPullRefresh,
30
+ ShQuery,
31
+ ShResult,
32
+ ShRow,
33
+ ShSplit,
34
+ ShGrid,
35
+ ShTable,
36
+ ShTabs,
37
+ ShTag,
38
+ ShToolbar,
39
+ ShTree,
40
+ ShUpload,
41
+ ShWaterFall,
42
+ ShWaterMark
10
43
 
44
+ 2. 手动安装(业务):
45
+ ShCronModal(cron表达式),
46
+ ShMarkdown(富文本编辑),
47
+ ShMenu(菜单、支持竖向、横向、收起)
11
48
 
12
49
  #### 安装教程
50
+ 版本:[vue](https://www.npmjs.com/package/vue) 3.x
51
+ ```shell
52
+ npm install sh-tools sh-view@next
53
+ ```
54
+ ```javascript
55
+ import { createApp } from 'vue'
56
+ import ShView from 'sh-view'
13
57
 
14
- 1. xxxx
15
- 2. xxxx
16
- 3. xxxx
58
+ createApp(App).use(ShView).mount('#app')
59
+ ```
17
60
 
18
61
  #### 使用说明
19
62
 
20
- 1. xxxx
21
- 2. xxxx
22
- 3. xxxx
63
+ 1. 暂无文档,请参考示例或者组件api
64
+ 2. 作者QQ:577754811
23
65
 
24
- #### 参与贡献
25
66
 
26
- 1. Fork 本仓库
27
- 2. 新建 Feat_xxx 分支
28
- 3. 提交代码
29
- 4. 新建 Pull Request
67
+ #### 功能计划
68
+ * [x] v2.6.4 基于 vxe4.+,包含vxe-table所有功能,扩展更强渲染器
69
+ * [ ] 下一阶段:独立vxe的日历组件,独立范围选择日期渲染器;低代码配置;基础sh-view的admin系统开源(包含低代码设计模板,及系统鉴权、路由守卫等)
30
70
 
31
71
 
32
- #### 特技
33
-
34
- 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
35
- 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
36
- 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
37
- 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
38
- 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
39
- 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
72
+ #### 项目预览
73
+ <img alt="img.png" src="examples/assets/img/img.png" width="100%"/>
74
+ <img alt="img_1.png" src="examples/assets/img/img_1.png" width="49%"/>
75
+ <img alt="img_2.png" src="examples/assets/img/img_2.png" width="49%"/>
76
+ <img alt="img_3.png" src="examples/assets/img/img_3.png" width="49%"/>
77
+ <img alt="img_4.png" src="examples/assets/img/img_4.png" width="49%"/>
78
+ <img alt="img_5.png" src="examples/assets/img/img_5.png" width="49%"/>
79
+ <img alt="img_6.png" src="examples/assets/img/img_6.png" width="49%"/>
80
+ <img alt="img_7.png" src="examples/assets/img/img_7.png" width="49%"/>
81
+ <img alt="img_8.png" src="examples/assets/img/img_8.png" width="49%"/>
82
+ <img alt="img_9.png" src="examples/assets/img/img_9.png" width="49%"/>
83
+ <img alt="img_10.png" src="examples/assets/img/img_10.png" width="49%"/>
84
+ <img alt="img_11.png" src="examples/assets/img/img_11.png" width="49%"/>
85
+ <img alt="img_12.png" src="examples/assets/img/img_12.png" width="49%"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-view",
3
- "version": "2.6.4",
3
+ "version": "2.6.5",
4
4
  "description": "基于vxe-table二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -1,69 +1,68 @@
1
- <script>
2
- import { computed, defineComponent, getCurrentInstance, h, inject, ref, resolveComponent, renderSlot } from 'vue'
3
- import { turnColumnItemFilters } from '../js/tableMethods'
4
- export default defineComponent({
5
- name: 'ShColumn',
6
- props: {
7
- column: {
8
- type: Object
9
- }
10
- },
11
- setup(props, context) {
12
- const { proxy } = getCurrentInstance()
13
- const { $vUtils } = proxy
14
- const shTable = inject('ShTableInstance')
15
-
16
- const isGroup = computed(() => {
17
- return proxy.hasChildren(props.column)
18
- })
19
- const columnConfig = computed(() => {
20
- let renderObj = { name: props.column.renderName, props: props.column.renderProps }
21
- let config = Object.assign({}, shTable.columnObjConfig, props.column)
22
- if (props.column.readonly) {
23
- config.cellRender = config.cellRender || renderObj
24
- } else {
25
- config.editRender = config.editRender || renderObj
26
- }
27
- if (config.renderName === '$vMoney' && props.column.renderProps.bill) {
28
- config.filter = false
29
- config.headerClassName += ' header-bill-cell'
30
- }
31
- if (config.filter === true || Number(config.filter) === 1) {
32
- shTable.turnColumnItemFilters(config, renderObj.props)
33
- }
34
- return $vUtils.omit(config, ['renderName', 'renderProps', 'renderRequire', 'requireProps'])
35
- })
36
- const groupConfig = computed(() => {
37
- return $vUtils.omit(columnConfig.value, ['children', 'cellRender', 'editRender'])
38
- })
39
- const renderVN = () => {
40
- let columnSlots = {}
41
- if (props.column.slots) {
42
- Object.keys(props.column.slots).map(key => {
43
- columnSlots[key] = shTable.slots[props.column.slots[key]]
44
- })
45
- }
46
- if (isGroup.value) {
47
- let childrenList = props.column.children.map(child => {
48
- return h(resolveComponent('sh-column'), { column: child })
49
- })
50
- columnSlots.default = () => childrenList
51
- return h(resolveComponent('vxe-colgroup'), { ...groupConfig.value }, columnSlots)
52
- }
53
- return h(resolveComponent('vxe-column'), { ...columnConfig.value }, columnSlots)
54
- }
55
-
56
- return {
57
- isGroup,
58
- columnConfig,
59
- groupConfig,
60
- renderVN
61
- }
62
- },
63
- render() {
64
- return this.renderVN()
65
- }
66
- })
67
- </script>
68
-
69
- <style scoped lang="scss"></style>
1
+ <script>
2
+ import { computed, defineComponent, getCurrentInstance, h, inject, ref, resolveComponent, renderSlot } from 'vue'
3
+ export default defineComponent({
4
+ name: 'ShColumn',
5
+ props: {
6
+ column: {
7
+ type: Object
8
+ }
9
+ },
10
+ setup(props, context) {
11
+ const { proxy } = getCurrentInstance()
12
+ const { $vUtils } = proxy
13
+ const shTable = inject('ShTableInstance')
14
+
15
+ const isGroup = computed(() => {
16
+ return proxy.hasChildren(props.column)
17
+ })
18
+ const columnConfig = computed(() => {
19
+ let renderObj = { name: props.column.renderName, props: props.column.renderProps }
20
+ let config = Object.assign({}, shTable.columnObjConfig, props.column)
21
+ if (props.column.readonly) {
22
+ config.cellRender = config.cellRender || renderObj
23
+ } else {
24
+ config.editRender = config.editRender || renderObj
25
+ }
26
+ if (config.renderName === '$vMoney' && props.column.renderProps.bill) {
27
+ config.filter = false
28
+ config.headerClassName += ' header-bill-cell'
29
+ }
30
+ if (config.filter === true || Number(config.filter) === 1) {
31
+ shTable.turnColumnItemFilters(config, renderObj.props)
32
+ }
33
+ return $vUtils.omit(config, ['children', 'renderName', 'renderProps', 'renderRequire', 'requireProps'])
34
+ })
35
+ const groupConfig = computed(() => {
36
+ return $vUtils.omit(columnConfig.value, ['cellRender', 'editRender'])
37
+ })
38
+ const renderVN = () => {
39
+ let columnSlots = {}
40
+ if (props.column.slots) {
41
+ Object.keys(props.column.slots).map(key => {
42
+ columnSlots[key] = shTable.slots[props.column.slots[key]]
43
+ })
44
+ }
45
+ if (isGroup.value) {
46
+ let childrenList = props.column.children.map(child => {
47
+ return h(resolveComponent('sh-column'), { column: child })
48
+ })
49
+ columnSlots.default = () => childrenList
50
+ return h(resolveComponent('vxe-colgroup'), { ...groupConfig.value }, columnSlots)
51
+ }
52
+ return h(resolveComponent('vxe-column'), { ...columnConfig.value }, columnSlots)
53
+ }
54
+
55
+ return {
56
+ isGroup,
57
+ columnConfig,
58
+ groupConfig,
59
+ renderVN
60
+ }
61
+ },
62
+ render() {
63
+ return this.renderVN()
64
+ }
65
+ })
66
+ </script>
67
+
68
+ <style scoped lang="scss"></style>
@@ -1,51 +1,51 @@
1
- <template>
2
- <span class="vxe-render--inner" style="display: inline-grid; width: 100%">
3
- <sh-table
4
- ref="shTableRef"
5
- :disabled="!redit && !isEditAll"
6
- v-bind="rprops"
7
- :size="rsize"
8
- :data-sourse="renderValue"
9
- @edit-closed="vxeInputCallback"
10
- @toolbaroption="onToolbaroption"></sh-table>
11
- </span>
12
- </template>
13
-
14
- <script>
15
- import { defineComponent, getCurrentInstance, ref } from 'vue'
16
- import cellProps from '../mixin/cell-props'
17
- import cellHooks from '../mixin/cell-hooks'
18
- export default defineComponent({
19
- name: 'VxeRenderTable',
20
- props: cellProps,
21
- setup(props, context) {
22
- const { proxy } = getCurrentInstance()
23
- const useCell = cellHooks(props, context, proxy)
24
- const shTableRef = ref()
25
-
26
- const fullData = () => {
27
- return shTableRef.value.getFullData()
28
- }
29
-
30
- // 输入框回调
31
- const vxeInputCallback = ({ $table, row }) => {
32
- driveBackData()
33
- }
34
- // 新增、删除行回调
35
- const onToolbaroption = (code, data, $table) => {
36
- driveBackData()
37
- }
38
- // 回填数据
39
- const driveBackData = value => {
40
- useCell.setRenderValue(fullData(), true)
41
- }
42
-
43
- return {
44
- ...useCell,
45
- shTableRef,
46
- vxeInputCallback,
47
- onToolbaroption
48
- }
49
- }
50
- })
51
- </script>
1
+ <template>
2
+ <span class="vxe-render--inner" style="display: inline-grid; width: 100%">
3
+ <sh-table
4
+ ref="shTableRef"
5
+ :disabled="!redit && !isEditAll"
6
+ v-bind="rprops"
7
+ :size="rsize"
8
+ :data-sourse="renderValue"
9
+ @edit-closed="vxeInputCallback"
10
+ @toolbaroption="onToolbaroption"></sh-table>
11
+ </span>
12
+ </template>
13
+
14
+ <script>
15
+ import { defineComponent, getCurrentInstance, ref } from 'vue'
16
+ import cellProps from '../mixin/cell-props'
17
+ import cellHooks from '../mixin/cell-hooks'
18
+ export default defineComponent({
19
+ name: 'VxeRenderTable',
20
+ props: cellProps,
21
+ setup(props, context) {
22
+ const { proxy } = getCurrentInstance()
23
+ const useCell = cellHooks(props, context, proxy)
24
+ const shTableRef = ref()
25
+
26
+ const fullData = () => {
27
+ return shTableRef.value.getFullData({ deleteXid: true })
28
+ }
29
+
30
+ // 输入框回调
31
+ const vxeInputCallback = ({ $table, row }) => {
32
+ driveBackData()
33
+ }
34
+ // 新增、删除行回调
35
+ const onToolbaroption = (code, data, $table) => {
36
+ driveBackData()
37
+ }
38
+ // 回填数据
39
+ const driveBackData = value => {
40
+ useCell.setRenderValue(fullData(), true)
41
+ }
42
+
43
+ return {
44
+ ...useCell,
45
+ shTableRef,
46
+ vxeInputCallback,
47
+ onToolbaroption
48
+ }
49
+ }
50
+ })
51
+ </script>