fx-platform-ui 0.0.13-alpha14 → 0.0.13-alpha16

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.
@@ -0,0 +1,61 @@
1
+ .pl-confirm-info {
2
+ .ant-modal-content {
3
+ border-radius: 10px;
4
+ }
5
+ .ant-modal-header {
6
+ border-radius: 10px;
7
+ border-bottom: 0;
8
+ padding: 24px 24px 0 24px;
9
+ text-align: center;
10
+ .ant-modal-title {
11
+ font-weight: 500;
12
+ font-size: 20px;
13
+ color: #222;
14
+ }
15
+ }
16
+ .ant-modal-body {
17
+ padding: 40px 24px;
18
+ font-size: 16px;
19
+ font-weight: 400;
20
+ text-align: center;
21
+ }
22
+ .ant-modal-footer {
23
+ padding: 0;
24
+ height: 58px;
25
+ .pl-confirm-footer {
26
+ display: flex;
27
+ align-items: center;
28
+ font-size: 16px;
29
+ color: #409eff;
30
+ position: relative;
31
+ height: 100%;
32
+ .pl-confirm-flex {
33
+ display: flex;
34
+ justify-content: center;
35
+ flex: 1;
36
+ }
37
+ }
38
+ .ant-btn {
39
+ font-size: 16px;
40
+ width: 100%;
41
+ height: 100%;
42
+ }
43
+ .pl-confirm-cancel:before {
44
+ position: absolute;
45
+ box-sizing: border-box;
46
+ content: ' ';
47
+ pointer-events: none;
48
+ top: -50%;
49
+ bottom: -50%;
50
+ left: 50%;
51
+ transform: scale(0.5);
52
+ border-right: 1px solid #f0f0f0;
53
+ color: #f0f0f0;
54
+ }
55
+ .pl-flex {
56
+ display: flex;
57
+ justify-content: center;
58
+ align-items: center;
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,91 @@
1
+ import { createVNode, render as vueRender } from 'vue'
2
+ import PlConfirm from './confirm.vue'
3
+ import type { PlatConfirmProps } from './plat-confirm-props'
4
+
5
+ const confirm = (props: any) => {
6
+ let confirmDialogInstance: any = null
7
+ const container = document.createDocumentFragment()
8
+ const close = (data?, args?) => {
9
+ currentConfig = {
10
+ ...currentConfig,
11
+ visible: false,
12
+ afterClose: () => {
13
+ if (typeof props.afterClose === 'function') {
14
+ props.afterClose()
15
+ }
16
+ destroy.apply(data, args)
17
+ }
18
+ }
19
+ update(currentConfig)
20
+ }
21
+ let currentConfig = {
22
+ maskClosable: false,
23
+ visible: true,
24
+ close,
25
+ type: 'info',
26
+ centered: true,
27
+ closable: false,
28
+ width: '360px',
29
+ height: '225px',
30
+ ...props
31
+ }
32
+ const destroy = (...args) => {
33
+ if (confirmDialogInstance) {
34
+ // destroy
35
+ vueRender(null, container as any)
36
+ confirmDialogInstance.component.update()
37
+ confirmDialogInstance = null
38
+ }
39
+ const triggerCancel = args.some((param) => param && param.triggerCancel)
40
+ if (props.onCancel && triggerCancel) {
41
+ props.onCancel(...args)
42
+ }
43
+ }
44
+ const update = (configUpdate: PlatConfirmProps) => {
45
+ currentConfig = {
46
+ ...currentConfig,
47
+ ...configUpdate
48
+ }
49
+ if (confirmDialogInstance) {
50
+ Object.assign(confirmDialogInstance.component.props, currentConfig)
51
+ confirmDialogInstance.component.update()
52
+ }
53
+ }
54
+ const Wrapper = (p) => {
55
+ return <PlConfirm {...p}></PlConfirm>
56
+ }
57
+ const render = (arg: PlatConfirmProps) => {
58
+ console.log(arg)
59
+ const vm = createVNode(Wrapper, { ...arg })
60
+ vm.appContext = props.parentContext || props.appContext || vm.appContext
61
+ vueRender(vm, container as any)
62
+ return vm
63
+ }
64
+ confirmDialogInstance = render(currentConfig)
65
+ return {
66
+ destroy: close,
67
+ update
68
+ }
69
+ }
70
+
71
+ const info = (props) => {
72
+ return {
73
+ okShow: true,
74
+ cancelShow: true,
75
+ ...props
76
+ }
77
+ }
78
+
79
+ // const PlConfirm = {
80
+ // info: (props) => {
81
+ // return confirm(info(props))
82
+ // }
83
+ // }
84
+
85
+ // PlConfirm.install = function (app: App) {
86
+ // app.component(Modal.name, Modal)
87
+ // return app
88
+ // }
89
+ PlConfirm.info = (props) => confirm(info(props))
90
+
91
+ export default PlConfirm
@@ -0,0 +1,40 @@
1
+ import { VNode, PropType, ExtractPropTypes } from 'vue'
2
+ import { modalProps } from 'ant-design-vue/es/modal/Modal'
3
+
4
+ export const platConfirmProps = {
5
+ ...modalProps(),
6
+ okShow: {
7
+ type: Boolean,
8
+ default: true
9
+ },
10
+ cancelShow: {
11
+ type: Boolean,
12
+ default: true
13
+ },
14
+ // 内容
15
+ content: {
16
+ type: [Object, String] as PropType<VNode | string>,
17
+ default: null
18
+ },
19
+ // 关闭函数
20
+ onCancel: {
21
+ type: Function as PropType<() => Promise<any>>
22
+ },
23
+ // 确认函数
24
+ onOk: {
25
+ type: Function as PropType<() => Promise<any>>
26
+ },
27
+ // 销毁函数
28
+ destroy: {
29
+ type: Function as PropType<(() => Promise<any>) | undefined>,
30
+ default: null
31
+ },
32
+ // 关闭函数
33
+ close: {
34
+ type: Function as PropType<() => Promise<any>>
35
+ }
36
+ }
37
+
38
+ export type PlatConfirmProps = Partial<
39
+ ExtractPropTypes<typeof platConfirmProps>
40
+ >
@@ -1,5 +1,5 @@
1
1
  import { computed, ref, watchEffect } from 'vue'
2
- // import tinymce from 'tinymce/tinymce'
2
+ import tinymce from 'tinymce/tinymce'
3
3
  import { message } from 'ant-design-vue'
4
4
  import { PlatEditorProps } from '../plat-editor-props'
5
5
  import { isFunction } from '../../../../utils/is'
@@ -54,9 +54,9 @@ export const useEditorState = (props: PlatEditorProps) => {
54
54
  inputElem.click()
55
55
  inputElem.onchange = function () {
56
56
  const file = inputElem.files[0]
57
- // tinymce.activeEditor?.setProgressState(true)
57
+ tinymce.activeEditor?.setProgressState(true)
58
58
  mediaBeforeUpload(file).then((res) => {
59
- // tinymce.activeEditor?.setProgressState(false)
59
+ tinymce.activeEditor?.setProgressState(false)
60
60
  callback(res)
61
61
  })
62
62
  }
@@ -7,7 +7,8 @@
7
7
  <script lang="ts" setup>
8
8
  import { onMounted, watch, ref } from 'vue'
9
9
  //在js中引入所需的主题和组件
10
- // import tinymce from 'tinymce/tinymce'
10
+ import tinymce from 'tinymce/tinymce'
11
+
11
12
  // import 'tinymce/skins/content/default/content.css'
12
13
  import Editor from '@tinymce/tinymce-vue'
13
14
  // import 'tinymce/themes/silver'
@@ -72,7 +73,7 @@ defineExpose(instance)
72
73
 
73
74
  //在onMounted中初始化编辑器
74
75
  onMounted(() => {
75
- // tinymce.init({})
76
+ tinymce.init({})
76
77
  })
77
78
  </script>
78
79
  <style lang="less" scoped>
@@ -109,7 +109,7 @@ export const useTableMethods = ({
109
109
  // @ts-ignore
110
110
  Object.assign(unref(paginationRef), pagination || {})
111
111
  await fetchData(params, rest)
112
- emit('change', ...rest)
112
+ emit('handleChange', ...rest)
113
113
  }
114
114
 
115
115
  // 获取表格列key
@@ -1,3 +1,3 @@
1
- export const platTableEmits = ['change']
1
+ export const platTableEmits = ['handleChange']
2
2
 
3
3
  export type PlatTableEmits = typeof platTableEmits
package/CHANGELOG.md DELETED
@@ -1,46 +0,0 @@
1
- ---
2
- title: '更新日志'
3
- lang: zh-CN
4
- ---
5
-
6
-
7
-
8
- ## 版本日志
9
-
10
- ## [0.0.12] - 2022-11-21
11
- ### 新增
12
- * 新增 `PlEditor`组件, 添加 富文本组件 该组件可在`PLform`使用
13
- * 新增 `PlTable`组件里 `setProps`方法用来动态添加`PlTable的props`
14
-
15
- ## [0.0.11] - 2022-11-11
16
- ### 新增
17
- * 新增 `PlTable`组件, 添加 分页dom`updatePageVnode`方法
18
-
19
- ## [0.0.10] - 2022-11-10
20
- ### 修改
21
- * 修改 `PlForm`组件, 解决无法传入官方`ant-design -vue`的Form API
22
-
23
- ## [0.0.9] - 2022-11-9
24
- ### 新增
25
- * 新增 `PlTable`组件, 添加针对`table`的显示隐藏属性`tableShow`
26
-
27
- ## [0.0.8] - 2022-11-4
28
- ### 新增、修改
29
- * 新增 `PlTable`组件, 添加`pin-manager-table`案例
30
- * 新增 `PlTable`组件里`actions`,添加`componentType`,解决操作列可能是文本的情况
31
- * 修改 `PlForm`组件,表单每一项,默认不清空
32
- * 修改 `PlForm`组件,表单操作按钮"是否隐藏" `bug`
33
-
34
- ## [0.0.7] - 2022-10-28
35
- ### 修改
36
- * 修改 `PlTable` 组件,添加ref属性,获取table里所有方法
37
-
38
- ## [0.0.6] - 2022-10-25
39
- ### 新增
40
- * 新增 `PlArea` 组件
41
-
42
- ## [0.0.5] - 2022-10-14
43
- ### 新增
44
- * 新增 `PlForm`, `PlTable` 组件
45
-
46
- ...