el-plus 0.0.81 → 0.0.83
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/CHANGELOG.md +12 -0
- package/dist/index.css +1 -1
- package/dist/index.full.js +73 -20
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +74 -21
- package/es/components/attachment/src/attachment.vue2.mjs +12 -2
- package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
- package/es/components/form/index.d.ts +3 -0
- package/es/components/form/src/form-item-vue.mjs +1 -1
- package/es/components/form/src/form-item-vue.mjs.map +1 -1
- package/es/components/form/src/form.vue.d.ts +1 -0
- package/es/components/form/src/form.vue2.mjs +14 -3
- package/es/components/form/src/form.vue2.mjs.map +1 -1
- package/es/components/form/src/hooks/use-form-item.d.ts +1 -1
- package/es/components/form/src/hooks/use-form-item.mjs +7 -2
- package/es/components/form/src/hooks/use-form-item.mjs.map +1 -1
- package/es/components/form/src/hooks/use-form.d.ts +2 -0
- package/es/components/form/src/hooks/use-form.mjs +16 -2
- package/es/components/form/src/hooks/use-form.mjs.map +1 -1
- package/es/components/search-list-page/index.d.ts +18 -6
- package/es/components/search-list-page/src/search-list-page.vue.d.ts +6 -2
- package/es/components/search-list-page/src/use-search-list-page.d.ts +6 -2
- package/es/components/table/index.d.ts +3 -0
- package/es/components/table/src/table.vue.d.ts +1 -0
- package/es/components/table/src/table.vue2.mjs +2 -0
- package/es/components/table/src/table.vue2.mjs.map +1 -1
- package/es/components/table/src/use-table.d.ts +1 -0
- package/es/components/table/src/use-table.mjs +4 -0
- package/es/components/table/src/use-table.mjs.map +1 -1
- package/es/hooks/dialog/use-dialog.d.ts +1 -0
- package/es/hooks/dialog/use-dialog.mjs +3 -0
- package/es/hooks/dialog/use-dialog.mjs.map +1 -1
- package/es/hooks/use-request.mjs +13 -8
- package/es/hooks/use-request.mjs.map +1 -1
- package/es/hooks/use-template-promise.d.ts +1 -0
- package/es/hooks/use-template-promise.mjs +1 -1
- package/es/hooks/use-template-promise.mjs.map +1 -1
- package/es/package.json.mjs +1 -1
- package/lib/components/attachment/src/attachment.vue2.js +12 -2
- package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
- package/lib/components/form/index.d.ts +3 -0
- package/lib/components/form/src/form-item-vue.js +1 -1
- package/lib/components/form/src/form-item-vue.js.map +1 -1
- package/lib/components/form/src/form.vue.d.ts +1 -0
- package/lib/components/form/src/form.vue2.js +14 -3
- package/lib/components/form/src/form.vue2.js.map +1 -1
- package/lib/components/form/src/hooks/use-form-item.d.ts +1 -1
- package/lib/components/form/src/hooks/use-form-item.js +7 -2
- package/lib/components/form/src/hooks/use-form-item.js.map +1 -1
- package/lib/components/form/src/hooks/use-form.d.ts +2 -0
- package/lib/components/form/src/hooks/use-form.js +15 -1
- package/lib/components/form/src/hooks/use-form.js.map +1 -1
- package/lib/components/search-list-page/index.d.ts +18 -6
- package/lib/components/search-list-page/src/search-list-page.vue.d.ts +6 -2
- package/lib/components/search-list-page/src/use-search-list-page.d.ts +6 -2
- package/lib/components/table/index.d.ts +3 -0
- package/lib/components/table/src/table.vue.d.ts +1 -0
- package/lib/components/table/src/table.vue2.js +2 -0
- package/lib/components/table/src/table.vue2.js.map +1 -1
- package/lib/components/table/src/use-table.d.ts +1 -0
- package/lib/components/table/src/use-table.js +4 -0
- package/lib/components/table/src/use-table.js.map +1 -1
- package/lib/hooks/dialog/use-dialog.d.ts +1 -0
- package/lib/hooks/dialog/use-dialog.js +3 -0
- package/lib/hooks/dialog/use-dialog.js.map +1 -1
- package/lib/hooks/use-request.js +13 -8
- package/lib/hooks/use-request.js.map +1 -1
- package/lib/hooks/use-template-promise.d.ts +1 -0
- package/lib/hooks/use-template-promise.js +1 -1
- package/lib/hooks/use-template-promise.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/package.json +1 -1
- package/theme-chalk/attachment.css +1 -1
- package/theme-chalk/header.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/attachment.scss +3 -0
- package/theme-chalk/src/header.scss +1 -1
- package/theme-chalk/src/table.scss +1 -0
- package/theme-chalk/src/title.scss +41 -43
- package/theme-chalk/table.css +1 -1
- package/theme-chalk/title.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dialog.js","sources":["../../../../../packages/hooks/dialog/use-dialog.tsx"],"sourcesContent":["import { useTemplatePromise } from '../use-template-promise'\nimport { h, getCurrentInstance, render as vRender, inject, nextTick } from 'vue'\nimport type { ComponentInternalInstance } from 'vue'\nimport {\n ElDialog,\n ElButton,\n configProviderContextKey,\n ElConfigProvider,\n} from 'element-plus'\nimport type { VNode } from 'vue'\nimport type { DialogProps } from 'element-plus'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareProps } from '@el-plus/utils/props'\nimport { useLocale } from '../use-locale'\n\nexport type DialogOptions = Partial<\n DialogProps & {\n instance: ComponentInternalInstance | null\n render: (props) => VNode\n scopedSlots: Record<string, (props) => VNode>\n class: string\n onCancel: (reject) => void\n onBeforeCancel: (reject) => void\n cancelText?: string\n onConfirm: (resolve) => void\n onBeforeConfirm: (resolve) => void\n confirmText?: string\n showFooter: boolean\n }\n>\nexport type ExpandDialogOptions = {\n title?: string\n dialogProps?: DialogOptions\n}\nconst bem = createNameSpace('dialog')\n\nexport const useDialog = (options: DialogOptions = {}) => {\n const { t } = useLocale()\n const {\n scopedSlots = {},\n instance,\n render,\n destroyOnClose,\n onConfirm,\n onBeforeConfirm,\n confirmText,\n onCancel,\n onBeforeCancel,\n cancelText,\n showFooter = true,\n ...dialogProps\n } = options\n\n const Dialog = useTemplatePromise<any>({\n destroy: destroyOnClose,\n render: (promiseOptions, ctx) => {\n // 插槽参数增加promiseOptions\n for (const key in scopedSlots) {\n scopedSlots[key] = scopedSlots[key].bind(null, promiseOptions)\n }\n const { resolve, reject, isResolving } = promiseOptions\n const renderFunc = () => {\n return render\n ? render(promiseOptions)\n : ctx.slots.default?.(promiseOptions)\n }\n const slots: DialogOptions['scopedSlots'] = {}\n if (showFooter) {\n slots.footer = () => (\n <div class={bem.e('footer')}>\n {scopedSlots.footerPrepend?.(promiseOptions)}\n <ElButton\n size=\"default\"\n onClick={async () => {\n if (onBeforeCancel) {\n await onBeforeCancel(reject)\n }\n if (onCancel) {\n onCancel(reject)\n } else {\n reject('cancel')\n }\n }}\n >\n {cancelText || t('ep.dialog.cancel')}\n </ElButton>\n {scopedSlots.footerInner?.(promiseOptions)}\n <ElButton\n type=\"primary\"\n onClick={async () => {\n if (onBeforeConfirm) {\n await onBeforeConfirm(resolve)\n }\n if (onConfirm) {\n onConfirm(resolve)\n } else {\n resolve('confirm')\n }\n }}\n loading={isResolving}\n >\n {confirmText || t('ep.dialog.confirm')}\n </ElButton>\n {scopedSlots.footerAppend?.(promiseOptions)}\n </div>\n )\n }\n return (\n <ElDialog\n class={bem.b()}\n modelValue={true}\n {...{\n closeOnClickModal: false,\n closeOnPressEscape: false,\n title: t('ep.dialog.title'),\n center: false,\n // 'append-to-body': true,\n beforeClose: () => {\n reject('cancel')\n },\n ...prepareProps(dialogProps, ['modelValue']),\n }}\n v-slots={{\n ...slots,\n ...scopedSlots,\n }}\n >\n {renderFunc()}\n </ElDialog>\n )\n },\n })\n if (render) {\n // const app = createApp(component)\n // Object.assign(app._context, parentInstance.appContext)\n // app.mount(container)\n const container = document.createElement('div')\n // container.setAttribute('id', 'ep-dialog-container')\n const newInstance = instance || getCurrentInstance()\n const config = inject(configProviderContextKey) as any\n // const parentConfig =\n // newInstance?.provides[configProviderContextKey] ||\n // newInstance?.appContext?.provides[configProviderContextKey]\n // const vnode = h(Dialog)\n const vnode = h(\n ElConfigProvider,\n { locale: config?.locale },\n { default: () => h(Dialog) },\n )\n if (newInstance && newInstance.appContext) {\n // 强制继承父应用的全局组件、指令和插件\n vnode.appContext = newInstance.appContext\n }\n nextTick(() => {\n vRender(vnode, container)\n document.body.appendChild(container)\n })\n }\n\n return Dialog\n}\n"],"names":["bem","createNameSpace","useDialog","options","t","useLocale","scopedSlots","instance","render","destroyOnClose","onConfirm","onBeforeConfirm","confirmText","onCancel","onBeforeCancel","cancelText","showFooter","dialogProps","Dialog","useTemplatePromise","destroy","promiseOptions","ctx","key","bind","resolve","reject","isResolving","renderFunc","slots","default","footer","_createVNode","e","footerPrepend","ElButton","footerInner","footerAppend","ElDialog","_mergeProps","b","closeOnClickModal","closeOnPressEscape","title","center","beforeClose","prepareProps","container","document","createElement","newInstance","getCurrentInstance","config","inject","configProviderContextKey","vnode","h","ElConfigProvider","locale","appContext","nextTick","vRender","body","appendChild"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-dialog.js","sources":["../../../../../packages/hooks/dialog/use-dialog.tsx"],"sourcesContent":["import { useTemplatePromise } from '../use-template-promise'\nimport { h, getCurrentInstance, render as vRender, inject, nextTick } from 'vue'\nimport type { ComponentInternalInstance } from 'vue'\nimport {\n ElDialog,\n ElButton,\n configProviderContextKey,\n ElConfigProvider,\n} from 'element-plus'\nimport type { VNode } from 'vue'\nimport type { DialogProps } from 'element-plus'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareProps } from '@el-plus/utils/props'\nimport { useLocale } from '../use-locale'\n\nexport type DialogOptions = Partial<\n DialogProps & {\n instance: ComponentInternalInstance | null\n render: (props) => VNode\n scopedSlots: Record<string, (props) => VNode>\n class: string\n templatePromiseClass: string\n onCancel: (reject) => void\n onBeforeCancel: (reject) => void\n cancelText?: string\n onConfirm: (resolve) => void\n onBeforeConfirm: (resolve) => void\n confirmText?: string\n showFooter: boolean\n }\n>\nexport type ExpandDialogOptions = {\n title?: string\n dialogProps?: DialogOptions\n}\nconst bem = createNameSpace('dialog')\n\nexport const useDialog = (options: DialogOptions = {}) => {\n const { t } = useLocale()\n const {\n scopedSlots = {},\n instance,\n render,\n destroyOnClose,\n onConfirm,\n onBeforeConfirm,\n confirmText,\n onCancel,\n onBeforeCancel,\n cancelText,\n showFooter = true,\n templatePromiseClass,\n ...dialogProps\n } = options\n\n const Dialog = useTemplatePromise<any>({\n destroy: destroyOnClose,\n class: templatePromiseClass,\n render: (promiseOptions, ctx) => {\n // 插槽参数增加promiseOptions\n for (const key in scopedSlots) {\n scopedSlots[key] = scopedSlots[key].bind(null, promiseOptions)\n }\n const { resolve, reject, isResolving } = promiseOptions\n const renderFunc = () => {\n return render\n ? render(promiseOptions)\n : ctx.slots.default?.(promiseOptions)\n }\n const slots: DialogOptions['scopedSlots'] = {}\n if (showFooter) {\n slots.footer = () => (\n <div class={bem.e('footer')}>\n {scopedSlots.footerPrepend?.(promiseOptions)}\n <ElButton\n size=\"default\"\n onClick={async () => {\n if (onBeforeCancel) {\n await onBeforeCancel(reject)\n }\n if (onCancel) {\n onCancel(reject)\n } else {\n reject('cancel')\n }\n }}\n >\n {cancelText || t('ep.dialog.cancel')}\n </ElButton>\n {scopedSlots.footerInner?.(promiseOptions)}\n <ElButton\n type=\"primary\"\n onClick={async () => {\n console.log(111);\n \n if (onBeforeConfirm) {\n await onBeforeConfirm(resolve)\n }\n if (onConfirm) {\n onConfirm(resolve)\n } else {\n resolve('confirm')\n }\n }}\n loading={isResolving}\n >\n {confirmText || t('ep.dialog.confirm')}\n </ElButton>\n {scopedSlots.footerAppend?.(promiseOptions)}\n </div>\n )\n }\n return (\n <ElDialog\n class={bem.b()}\n modelValue={true}\n {...{\n closeOnClickModal: false,\n closeOnPressEscape: false,\n title: t('ep.dialog.title'),\n center: false,\n // 'append-to-body': true,\n beforeClose: () => {\n reject('cancel')\n },\n ...prepareProps(dialogProps, ['modelValue']),\n }}\n v-slots={{\n ...slots,\n ...scopedSlots,\n }}\n >\n {renderFunc()}\n </ElDialog>\n )\n },\n })\n if (render) {\n // const app = createApp(component)\n // Object.assign(app._context, parentInstance.appContext)\n // app.mount(container)\n const container = document.createElement('div')\n // container.setAttribute('id', 'ep-dialog-container')\n const newInstance = instance || getCurrentInstance()\n const config = inject(configProviderContextKey) as any\n // const parentConfig =\n // newInstance?.provides[configProviderContextKey] ||\n // newInstance?.appContext?.provides[configProviderContextKey]\n // const vnode = h(Dialog)\n const vnode = h(\n ElConfigProvider,\n { locale: config?.locale },\n { default: () => h(Dialog) },\n )\n if (newInstance && newInstance.appContext) {\n // 强制继承父应用的全局组件、指令和插件\n vnode.appContext = newInstance.appContext\n }\n nextTick(() => {\n vRender(vnode, container)\n document.body.appendChild(container)\n })\n }\n\n return Dialog\n}\n"],"names":["bem","createNameSpace","useDialog","options","t","useLocale","scopedSlots","instance","render","destroyOnClose","onConfirm","onBeforeConfirm","confirmText","onCancel","onBeforeCancel","cancelText","showFooter","templatePromiseClass","dialogProps","Dialog","useTemplatePromise","destroy","class","promiseOptions","ctx","key","bind","resolve","reject","isResolving","renderFunc","slots","default","footer","_createVNode","e","footerPrepend","ElButton","footerInner","console","log","footerAppend","ElDialog","_mergeProps","b","closeOnClickModal","closeOnPressEscape","title","center","beforeClose","prepareProps","container","document","createElement","newInstance","getCurrentInstance","config","inject","configProviderContextKey","vnode","h","ElConfigProvider","locale","appContext","nextTick","vRender","body","appendChild"],"mappings":";;;;;;;;;AAmCA,MAAMA,GAAAA,GAAMC,sBAAgB,QAAQ,CAAA;AAE7B,MAAMC,SAAAA,GAAYA,CAACC,OAAAA,GAAyB,EAAC,KAAM;AACxD,EAAA,MAAM;AAAA,IAAEC;AAAAA,MAAMC,mBAAAA,EAAU;AACxB,EAAA,MAAM;AAAA,IACJC,cAAc,EAAC;AAAA,IACfC,QAAAA;AAAAA,IACAC,MAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA,GAAa,IAAA;AAAA,IACbC,oBAAAA;AAAAA,IACA,GAAGC;AAAAA,GACL,GAA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AAA,MAAA,CAO7CF,UAAAA,EAAY,CAAA;AAAA,QAJX,GAAGC,KAAAA;AAAAA,QACH,GAAGzB;AAAAA,OAAW,CAAA;AAAA,IAMtB;AAAA,GACD,CAAA;AACD,EAAA,IAAIE,MAAAA,EAAQ;AAIV,IAAA,MAAM2C,SAAAA,GAAYC,QAAAA,CAASC,aAAAA,CAAc,KAAK,CAAA;AAE9C,IAAA,MAAMC,WAAAA,GAAc/C,YAAYgD,sBAAAA,EAAmB;AACnD,IAAA,MAAMC,MAAAA,GAASC,WAAOC,oCAAwB,CAAA;AAK9C,IAAA,MAAMC,KAAAA,GAAQC,MACZC,4BAAAA,EACA;AAAA,MAAEC,QAAQN,MAAAA,EAAQM;AAAAA,KAAO,EACzB;AAAA,MAAE9B,OAAAA,EAASA,MAAM4B,KAAAA,CAAEzC,MAAM;AAAA,KAC3B,CAAA;AACA,IAAA,IAAImC,WAAAA,IAAeA,YAAYS,UAAAA,EAAY;AAEzCJ,MAAAA,KAAAA,CAAMI,aAAaT,WAAAA,CAAYS,UAAAA;AAAAA,IACjC;AACAC,IAAAA,YAAAA,CAAS,MAAM;AACbC,MAAAA,UAAAA,CAAQN,OAAOR,SAAS,CAAA;AACxBC,MAAAA,QAAAA,CAASc,IAAAA,CAAKC,YAAYhB,SAAS,CAAA;AAAA,IACrC,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAOhC,MAAAA;AACT;;;;"}
|
package/lib/hooks/use-request.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
+
var axios = require('axios');
|
|
4
5
|
var index = require('../utils/http/index.js');
|
|
5
6
|
|
|
6
7
|
const useRequest = ({
|
|
@@ -21,11 +22,6 @@ const useRequest = ({
|
|
|
21
22
|
const config = {
|
|
22
23
|
method
|
|
23
24
|
};
|
|
24
|
-
if (cancelToken) {
|
|
25
|
-
config.cancelRequest = (cancel) => {
|
|
26
|
-
cancelRequest = cancel;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
25
|
apiFn = (data = {}, params) => {
|
|
30
26
|
if (config.method === "get") {
|
|
31
27
|
config.params = data;
|
|
@@ -49,29 +45,38 @@ const useRequest = ({
|
|
|
49
45
|
if (reqBefore) {
|
|
50
46
|
reqBefore(config);
|
|
51
47
|
}
|
|
48
|
+
if (cancelToken) {
|
|
49
|
+
config.cancelToken = new axios.CancelToken(function(cancel) {
|
|
50
|
+
cancelRequest = cancel;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
52
53
|
return index.http.request(api, config);
|
|
53
54
|
};
|
|
54
55
|
} else {
|
|
55
56
|
apiFn = api;
|
|
56
57
|
}
|
|
57
|
-
const requestFn = async (data = {}) => {
|
|
58
|
+
const requestFn = async (data = {}, params) => {
|
|
58
59
|
if (loading.value && !cancelToken) return;
|
|
59
60
|
loading.value = true;
|
|
60
61
|
try {
|
|
61
62
|
cancelRequest && cancelRequest();
|
|
62
|
-
const res = await apiFn(data);
|
|
63
|
+
const res = await apiFn(data, params);
|
|
63
64
|
if (reqAfter) {
|
|
64
65
|
reqAfter(res);
|
|
65
66
|
}
|
|
66
67
|
if (hooks?.success) {
|
|
67
68
|
hooks.success(typeof api === "function" ? res : res.data);
|
|
68
69
|
}
|
|
70
|
+
loading.value = false;
|
|
69
71
|
} catch (error) {
|
|
70
72
|
if (hooks?.fail) {
|
|
71
73
|
hooks.fail(error);
|
|
72
74
|
}
|
|
73
|
-
|
|
75
|
+
if (axios.isCancel(error)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
74
78
|
loading.value = false;
|
|
79
|
+
} finally {
|
|
75
80
|
}
|
|
76
81
|
};
|
|
77
82
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-request.js","sources":["../../../../packages/hooks/use-request.ts"],"sourcesContent":["import { ref } from 'vue'\nimport { type Ref } from 'vue'\nimport type { Api, ReqAfter, ReqBefore, Method } from '@el-plus/types'\nimport type { Canceler } from 'axios'\nimport { http } from '@el-plus/utils/http'\ntype UseRequest = (config: {\n api?: Api\n method?: Method\n reqData?: Record<string, unknown>\n reqParams?: Record<string, unknown>\n reqBefore?: ReqBefore\n reqAfter?: ReqAfter\n cancelToken?: boolean\n hooks?: {\n success?: (data: unknown) => void\n fail?: (error: unknown) => void\n }\n}) => {\n loading?: Ref<boolean>\n requestFn?: (data?: Record<string, unknown>) => Promise<void>\n}\n\nexport const useRequest: UseRequest = ({\n api,\n method = 'post',\n reqData,\n reqParams,\n reqBefore,\n reqAfter,\n cancelToken,\n hooks,\n}) => {\n if (!api) return {}\n const loading = ref(false)\n let cancelRequest: Canceler\n let apiFn\n if (typeof api === 'string') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const config: Record<string, any> = {\n method,\n }\n
|
|
1
|
+
{"version":3,"file":"use-request.js","sources":["../../../../packages/hooks/use-request.ts"],"sourcesContent":["import { ref } from 'vue'\nimport { type Ref } from 'vue'\nimport type { Api, ReqAfter, ReqBefore, Method } from '@el-plus/types'\nimport type { Canceler } from 'axios'\nimport axios from 'axios'\nimport { http } from '@el-plus/utils/http'\ntype UseRequest = (config: {\n api?: Api\n method?: Method\n reqData?: Record<string, unknown>\n reqParams?: Record<string, unknown>\n reqBefore?: ReqBefore\n reqAfter?: ReqAfter\n cancelToken?: boolean\n hooks?: {\n success?: (data: unknown) => void\n fail?: (error: unknown) => void\n }\n}) => {\n loading?: Ref<boolean>\n requestFn?: (data?: Record<string, unknown>) => Promise<void>\n}\n\nexport const useRequest: UseRequest = ({\n api,\n method = 'post',\n reqData,\n reqParams,\n reqBefore,\n reqAfter,\n cancelToken,\n hooks,\n}) => {\n if (!api) return {}\n const loading = ref(false)\n let cancelRequest: Canceler\n let apiFn\n if (typeof api === 'string') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const config: Record<string, any> = {\n method,\n }\n apiFn = (data: Record<string, any> = {}, params?: Record<string, any>) => {\n if (config.method === 'get') {\n config.params = data\n } else {\n config.data = data\n config.params = params\n }\n config.data = {\n ...reqData,\n ...config.data,\n }\n config.params = {\n ...reqParams,\n ...config.params,\n }\n // 替换$query为$searchValue\n if (config.data.$query) {\n config.data[config.data.$query] = data.$searchValue\n delete config.data.$searchValue\n delete config.data.$query\n }\n\n if (reqBefore) {\n reqBefore(config)\n }\n if (cancelToken) {\n config.cancelToken = new axios.CancelToken(function (cancel) {\n cancelRequest = cancel\n })\n }\n return http.request(api, config)\n }\n } else {\n apiFn = api\n }\n const requestFn = async (data: Record<string, unknown> = {}, params?: Record<string, unknown>) => {\n if (loading.value && !cancelToken) return\n loading.value = true\n try {\n cancelRequest && cancelRequest()\n const res = await apiFn(data, params)\n // 如果api是函数,直接追加success,data\n if (reqAfter) {\n reqAfter(res)\n }\n if (hooks?.success) {\n hooks.success(typeof api === 'function' ? res : res.data)\n }\n loading.value = false\n\n } catch (error) {\n if (hooks?.fail) {\n hooks.fail(error)\n }\n if(axios.isCancel(error)){\n return\n }\n loading.value = false\n } finally {\n }\n }\n return {\n loading,\n requestFn,\n }\n}\n"],"names":["ref","http"],"mappings":";;;;;;AAuBO,MAAM,aAAyB,CAAC;AAAA,EACrC,GAAA;AAAA,EACA,MAAA,GAAS,MAAA;AAAA,EACT,OAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,IAAI,CAAC,GAAA,EAAK,OAAO,EAAC;AAClB,EAAA,MAAM,OAAA,GAAUA,QAAI,KAAK,CAAA;AACzB,EAAA,IAAI,aAAA;AACJ,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI,OAAO,QAAQ,QAAA,EAAU;AAE3B,IAAA,MAAM,MAAA,GAA8B;AAAA,MAClC;AAAA,KACF;AACA,IAAA,KAAA,GAAQ,CAAC,IAAA,GAA4B,EAAC,EAAG,MAAA,KAAiC;AACxE,MAAA,IAAI,MAAA,CAAO,WAAW,KA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,EAAc;AAC/B,MAAA,MAAM,GAAA,GAAM,MAAM,KAAA,CAAM,IAAA,EAAM,MAAM,CAAA;AAEpC,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,QAAA,CAAS,GAAG,CAAA;AAAA,MACd;AACA,MAAA,IAAI,OAAO,OAAA,EAAS;AAClB,QAAA,KAAA,CAAM,QAAQ,OAAO,GAAA,KAAQ,UAAA,GAAa,GAAA,GAAM,IAAI,IAAI,CAAA;AAAA,MAC1D;AACA,MAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA;AAAA,IAElB,SAAS,KAAA,EAAO;AACd,MAAA,IAAI,OAAO,IAAA,EAAM;AACf,QAAA,KAAA,CAAM,KAAK,KAAK,CAAA;AAAA,MAClB;AACA,MAAA,IAAG,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAE;AACvB,QAAA;AAAA,MACF;AACA,MAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA;AAAA,IAClB,CAAA,SAAE;AAAA,IACF;AAAA,EACF,CAAA;AACA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -3,6 +3,7 @@ export interface TemplatePromiseOptions {
|
|
|
3
3
|
transition?: TransitionProps;
|
|
4
4
|
destroy?: boolean;
|
|
5
5
|
render?: (props: any, ctx: SetupContext) => VNode;
|
|
6
|
+
class?: string;
|
|
6
7
|
}
|
|
7
8
|
export type TemplatePromise<Return, Args extends any[] = []> = DefineComponent<object> & {} & {
|
|
8
9
|
open: (...args: Args) => Promise<Return>;
|
|
@@ -71,7 +71,7 @@ const useTemplatePromise = (options = {}) => {
|
|
|
71
71
|
const renderList = () => instances.value.map((props) => {
|
|
72
72
|
return vue.withDirectives(vue.h("div", {
|
|
73
73
|
// key: props.key,
|
|
74
|
-
class:
|
|
74
|
+
class: `ep-template-promise is-init ${options.class || ""}`
|
|
75
75
|
}, render ? render(props, ctx) : slots.default?.(props)), [[vue.vShow, props.isVisible]]);
|
|
76
76
|
});
|
|
77
77
|
if (transition) return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-template-promise.js","sources":["../../../../packages/hooks/use-template-promise.tsx"],"sourcesContent":["// 参考 https://github.com/vueuse/vueuse/blob/main/packages/core/createTemplatePromise/index.ts\n\nimport type {\n DefineComponent,\n Ref,\n TransitionProps,\n VNode,\n SetupContext,\n} from 'vue'\nimport {\n defineComponent,\n ref,\n shallowReactive,\n Transition,\n Fragment,\n h,\n createApp,\n getCurrentInstance,\n render as vRender,\n markRaw,\n withDirectives,\n vShow,\n nextTick,\n} from 'vue'\n\nexport interface TemplatePromiseOptions {\n // 过渡\n transition?: TransitionProps\n // 是否销毁\n destroy?: boolean\n // 自定义渲染\n render?: (props, ctx: SetupContext) => VNode\n}\nexport type TemplatePromise<\n Return,\n Args extends any[] = [],\n> = DefineComponent<object> & {\n // new (): {\n // $slots: {\n // default: (_: TemplatePromiseProps<Return, Args>) => any\n // }\n // }\n} & {\n open: (...args: Args) => Promise<Return>\n}\nexport interface TemplatePromiseProps<Return, Args extends any[] = []> {\n promise: Promise<Return> | undefined\n resolve: (v: Return) => void\n reject: (v: any) => void\n args: Args\n options: TemplatePromiseOptions\n isResolving: boolean\n isVisible: boolean\n key: number\n}\nexport const useTemplatePromise = <Return, Args extends any[] = []>(\n options: TemplatePromiseOptions = {},\n): TemplatePromise<Return, Args> => {\n const {\n destroy = false,\n render,\n transition = {\n name: 'fade',\n appear: true,\n },\n } = options\n const instances = ref([]) as Ref<TemplatePromiseProps<Return, Args>[]>\n let index = 0\n\n const create = (...args: Args) => {\n const key = index++\n const props = shallowReactive<TemplatePromiseProps<Return, Args>>({\n key,\n args,\n promise: undefined,\n resolve: () => {},\n reject: () => {},\n isResolving: false,\n isVisible: true,\n options,\n })\n instances.value.push(props)\n props.promise = new Promise<Return>((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true\n return _resolve(v)\n }\n props.reject = _reject\n }).finally(() => {\n if (destroy) {\n props.promise = undefined\n const index = instances.value.indexOf(props)\n if (index !== -1) instances.value.splice(index, 1)\n } else {\n props.isVisible = false\n // const wrapper = document.querySelector(\n // '.ep-template-promise',\n // ) as HTMLElement\n // if (wrapper.style['zIndex']) {\n // return\n // }\n // const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n // const zIndex = dialog ? dialog.style['z-index'] : ''\n // if (zIndex && wrapper) {\n // wrapper.style.zIndex = zIndex\n // }\n }\n })\n return props.promise\n }\n const open = (...args: Args) => {\n instances.value = []\n const com = create(...args)\n nextTick(() => {\n const wrapper = document.querySelector(\n '.ep-template-promise.is-init',\n ) as HTMLElement\n if (wrapper) {\n const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n const zIndex = dialog ? dialog.style['z-index'] : ''\n if (zIndex && wrapper) {\n wrapper.style.zIndex = zIndex\n }\n // 删除is-init的class\n wrapper.classList.remove('is-init')\n }\n })\n return com\n }\n const component = defineComponent((_, ctx) => {\n const { slots } = ctx\n const renderList = () =>\n instances.value.map((props) => {\n return withDirectives(\n h(\n 'div',\n {\n // key: props.key,\n class:
|
|
1
|
+
{"version":3,"file":"use-template-promise.js","sources":["../../../../packages/hooks/use-template-promise.tsx"],"sourcesContent":["// 参考 https://github.com/vueuse/vueuse/blob/main/packages/core/createTemplatePromise/index.ts\n\nimport type {\n DefineComponent,\n Ref,\n TransitionProps,\n VNode,\n SetupContext,\n} from 'vue'\nimport {\n defineComponent,\n ref,\n shallowReactive,\n Transition,\n Fragment,\n h,\n createApp,\n getCurrentInstance,\n render as vRender,\n markRaw,\n withDirectives,\n vShow,\n nextTick,\n} from 'vue'\n\nexport interface TemplatePromiseOptions {\n // 过渡\n transition?: TransitionProps\n // 是否销毁\n destroy?: boolean\n // 自定义渲染\n render?: (props, ctx: SetupContext) => VNode\n // class 名\n class?: string\n}\nexport type TemplatePromise<\n Return,\n Args extends any[] = [],\n> = DefineComponent<object> & {\n // new (): {\n // $slots: {\n // default: (_: TemplatePromiseProps<Return, Args>) => any\n // }\n // }\n} & {\n open: (...args: Args) => Promise<Return>\n}\nexport interface TemplatePromiseProps<Return, Args extends any[] = []> {\n promise: Promise<Return> | undefined\n resolve: (v: Return) => void\n reject: (v: any) => void\n args: Args\n options: TemplatePromiseOptions\n isResolving: boolean\n isVisible: boolean\n key: number\n}\nexport const useTemplatePromise = <Return, Args extends any[] = []>(\n options: TemplatePromiseOptions = {},\n): TemplatePromise<Return, Args> => {\n const {\n destroy = false,\n render,\n transition = {\n name: 'fade',\n appear: true,\n },\n } = options\n const instances = ref([]) as Ref<TemplatePromiseProps<Return, Args>[]>\n let index = 0\n\n const create = (...args: Args) => {\n const key = index++\n const props = shallowReactive<TemplatePromiseProps<Return, Args>>({\n key,\n args,\n promise: undefined,\n resolve: () => {},\n reject: () => {},\n isResolving: false,\n isVisible: true,\n options,\n })\n instances.value.push(props)\n props.promise = new Promise<Return>((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true\n return _resolve(v)\n }\n props.reject = _reject\n }).finally(() => {\n if (destroy) {\n props.promise = undefined\n const index = instances.value.indexOf(props)\n if (index !== -1) instances.value.splice(index, 1)\n } else {\n props.isVisible = false\n // const wrapper = document.querySelector(\n // '.ep-template-promise',\n // ) as HTMLElement\n // if (wrapper.style['zIndex']) {\n // return\n // }\n // const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n // const zIndex = dialog ? dialog.style['z-index'] : ''\n // if (zIndex && wrapper) {\n // wrapper.style.zIndex = zIndex\n // }\n }\n })\n return props.promise\n }\n const open = (...args: Args) => {\n instances.value = []\n const com = create(...args)\n nextTick(() => {\n const wrapper = document.querySelector(\n '.ep-template-promise.is-init',\n ) as HTMLElement\n if (wrapper) {\n const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n const zIndex = dialog ? dialog.style['z-index'] : ''\n if (zIndex && wrapper) {\n wrapper.style.zIndex = zIndex\n }\n // 删除is-init的class\n wrapper.classList.remove('is-init')\n }\n })\n return com\n }\n const component = defineComponent((_, ctx) => {\n const { slots } = ctx\n const renderList = () =>\n instances.value.map((props) => {\n return withDirectives(\n h(\n 'div',\n {\n // key: props.key,\n class: `ep-template-promise is-init ${options.class || ''}`,\n },\n render ? render(props, ctx) : slots.default?.(props),\n ),\n [[vShow, props.isVisible]],\n )\n })\n if (transition)\n return () => <Transition {...transition}>{renderList()}</Transition>\n\n return renderList\n })\n // @ts-expect-error There's a breaking type change in Vue 3.3 <https://github.com/vuejs/core/pull/7963>\n component.open = open\n return markRaw(component as TemplatePromise<Return, Args>)\n}\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","useTemplatePromise","options","destroy","render","transition","name","appear","instances","ref","index","create","args","key","props","shallowReactive","promise","undefined","resolve","reject","isResolving","isVisible","value","push","Promise","_resolve","_reject","v","finally","indexOf","splice","open","com","nextTick","wrapper","document","querySelector","dialog","zIndex","style","classList","remove","component","defineComponent","_","ctx","slots","renderList","map","withDirectives","h","class","default","vShow","_slot","_createVNode","Transition","markRaw"],"mappings":";;;;AAuBY,SAAAA,QAAAC,CAAAA,EAAA;AAAA,EAAA,OAAA,OAAAA,CAAAA,KAAA,UAAA,IAAAC,MAAAA,CAAAC,SAAAA,CAAAC,QAAAA,CAAAC,IAAAA,CAAAJ,CAAA,CAAA,KAAA,iBAAA,IAAA,CAAAK,WAAAA,CAAAL,CAAA,CAAA;AAAA;AAkCL,MAAMM,kBAAAA,GAAqBA,CAChCC,OAAAA,GAAkC,EAAC,KACD;AAClC,EAAA,MAAM;AAAA,IACJC,OAAAA,GAAU,KAAA;AAAA,IACVC,MAAAA;AAAAA,IACAC,UAAAA,GAAa;AAAA,MACXC,IAAAA,EAAM,MAAA;AAAA,MACNC,MAAAA,EAAQ;AAAA;AACV,GACF,GAAIL,OAAAA;AACJ,EAAA,MAAMM,SAAAA,GAAYC,OAAAA,CAAI,EAAE,CAAA;AACxB,EAAA,IAAIC,KAAAA,GAAQ,CAAA;AAEZ,EAAA,MAAMC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A,CAAC,CAACuC,WAAOvC,KAAAA,CAAMO,SAAS,CAAC,CAC3B,CAAA;AAAA,IACF,CAAC,CAAA;AACH,IAAA,IAAIhB,UAAAA,SACK,MAAA;AAAA,MAAA,IAAAiD,KAAAA;AAAA,MAAA,OAAAC,eAAAA,CAAAC,gBAAsBnD,UAAAA,EAAUX,OAAAA,CAAA4D,QAAGP,UAAAA,EAAY,IAAAO,KAAAA,GAAA;AAAA,QAAAF,OAAAA,EAAAA,MAAA,CAAAE,KAAA;AAAA,OAAA,CAAA;AAAA,IAAA,CAAA;AAExD,IAAA,OAAOP,UAAAA;AAAAA,EACT,CAAC,CAAA;AAEDL,EAAAA,SAAAA,CAAUX,IAAAA,GAAOA,IAAAA;AACjB,EAAA,OAAO0B,YAAQf,SAA0C,CAAA;AAC3D;;;;"}
|
package/lib/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ep-attachment__dialog--normal{background:none;position:static!important}.ep-attachment__dialog--normal .el-overlay-dialog{position:static}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog{margin:0;padding:0;width:auto!important}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog .el-dialog__header{display:none}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog .el-dialog__body{padding:0}.ep-attachment__handler{height:32px;padding:9px 15px}.ep-attachment__handler.el-button--text{padding:0}
|
|
1
|
+
.ep-attachment__promise{width:100%}.ep-attachment__dialog--normal{background:none;position:static!important}.ep-attachment__dialog--normal .el-overlay-dialog{position:static}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog{margin:0;padding:0;width:auto!important}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog .el-dialog__header{display:none}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog .el-dialog__body{padding:0}.ep-attachment__handler{height:32px;padding:9px 15px}.ep-attachment__handler.el-button--text{padding:0}
|
package/theme-chalk/header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ep-header{display:flex;
|
|
1
|
+
.ep-header{display:flex;flex-wrap:wrap}.ep-header>.el-button{margin-bottom:10px}.ep-header .el-page-header .el-page-header__left{margin-right:-10px;margin-top:4px}.ep-header .el-page-header .el-page-header__title{white-space:nowrap}
|
package/theme-chalk/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}.ep-form{position:relative}.ep-form__fold{bottom:23px;color:#367ef5;cursor:pointer;font-size:14px;position:absolute;right:0;text-align:center;width:70px}.ep-form__fold:hover{text-decoration:underline}.ep-form.is-fold{padding-right:70px}.ep-form .el-form-item--small{margin-bottom:18px}.ep-form .el-form-item--small.is-hide-label .el-form-item__label{display:none}.ep-form .el-form-item--small .el-form-item__label{display:block;height:32px;line-height:32px;overflow:hidden;padding-left:18px;padding-right:6px;text-overflow:ellipsis;white-space:nowrap}.ep-form .el-form-item--small .el-form-item__content{font-size:13px;line-height:32px}.ep-form .el-form-item--small .el-form-item__content .el-input{font-size:13px;height:32px}.ep-form .el-form-item--small .el-form-item__content .el-textarea__inner{font-size:13px!important}.ep-form .el-form-item--small .el-form-item__content .el-select__wrapper{font-size:13px;line-height:32px;min-height:32px}.ep-form .el-form-item--small .el-form-item__content .el-date-editor .el-range-input{font-size:13px}.ep-table__action-buttons{white-space:nowrap}.ep-table .el-table{font-size:13px}.ep-table .el-table .el-table__cell .is-edit{cursor:pointer}.ep-table .el-table .el-table__cell .is-edit:hover{color:#409eff}.ep-table .el-table .el-table__cell .is-edit .el-icon{vertical-align:-2px}.ep-table .el-table .el-table__cell.is-center .el-link{margin:0 auto;text-align:center}.ep-table .el-table .cell{line-height:30px}.ep-table .el-table thead tr th{height:42px}.ep-table .el-table thead tr th .cell{line-height:20px}.ep-table .el-table thead tr th .el-checkbox__inner{height:14px;width:14px}.ep-table .el-table td,.ep-table .el-table th{padding:3px 0}.ep-table .el-form-item__error{position:unset;text-align:left}.ep-table .el-form-item{margin-bottom:0}.ep-table .el-form-item .el-form-item__label{padding:0}.ep-table .el-pagination{margin-top:12px;--el-pagination-font-size:13px}.ep-table .el-pagination .el-select{--el-select-font-size:13px}.ep-table .el-pagination .el-select .el-select__wrapper{font-size:13px}.ep-button{height:32px;padding:9px 15px}.ep-button.el-button--text{padding:0}.ep-button.el-button+.el-button{margin-left:10px}.ep-search-list-page #middle{overflow:hidden}.ep-search-list-page__middle-left{float:left}.ep-search-list-page__middle-left>.el-button{margin:16px 0}.ep-search-list-page__middle-right{float:right}.ep-search-list-page__middle-right .el-button{margin:16px 0}.ep-title__header{line-height:50px;overflow:hidden}.ep-title__title{float:left;font-size:15px;font-weight:500}.ep-title__toggle{color:#409eff;cursor:pointer;display:inline-block;font-size:14px;font-weight:400;margin-left:10px;white-space:nowrap}.ep-title__toggle .el-icon{transition:transform .3s;vertical-align:-2px}.ep-title.is-expanded .ep-title__toggle .el-icon{transform:rotate(-180deg)}.ep-title__buttons{float:right}.ep-title__content{overflow:hidden;transition:max-height .3s ease-in-out}.ep-header{display:flex;
|
|
1
|
+
.fade-enter-active,.fade-leave-active{transition:opacity .3s ease}.fade-enter-from,.fade-leave-to{opacity:0}body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}.ep-form{position:relative}.ep-form__fold{bottom:23px;color:#367ef5;cursor:pointer;font-size:14px;position:absolute;right:0;text-align:center;width:70px}.ep-form__fold:hover{text-decoration:underline}.ep-form.is-fold{padding-right:70px}.ep-form .el-form-item--small{margin-bottom:18px}.ep-form .el-form-item--small.is-hide-label .el-form-item__label{display:none}.ep-form .el-form-item--small .el-form-item__label{display:block;height:32px;line-height:32px;overflow:hidden;padding-left:18px;padding-right:6px;text-overflow:ellipsis;white-space:nowrap}.ep-form .el-form-item--small .el-form-item__content{font-size:13px;line-height:32px}.ep-form .el-form-item--small .el-form-item__content .el-input{font-size:13px;height:32px}.ep-form .el-form-item--small .el-form-item__content .el-textarea__inner{font-size:13px!important}.ep-form .el-form-item--small .el-form-item__content .el-select__wrapper{font-size:13px;line-height:32px;min-height:32px}.ep-form .el-form-item--small .el-form-item__content .el-date-editor .el-range-input{font-size:13px}.ep-table{width:100%}.ep-table__action-buttons{white-space:nowrap}.ep-table .el-table{font-size:13px}.ep-table .el-table .el-table__cell .is-edit{cursor:pointer}.ep-table .el-table .el-table__cell .is-edit:hover{color:#409eff}.ep-table .el-table .el-table__cell .is-edit .el-icon{vertical-align:-2px}.ep-table .el-table .el-table__cell.is-center .el-link{margin:0 auto;text-align:center}.ep-table .el-table .cell{line-height:30px}.ep-table .el-table thead tr th{height:42px}.ep-table .el-table thead tr th .cell{line-height:20px}.ep-table .el-table thead tr th .el-checkbox__inner{height:14px;width:14px}.ep-table .el-table td,.ep-table .el-table th{padding:3px 0}.ep-table .el-form-item__error{position:unset;text-align:left}.ep-table .el-form-item{margin-bottom:0}.ep-table .el-form-item .el-form-item__label{padding:0}.ep-table .el-pagination{margin-top:12px;--el-pagination-font-size:13px}.ep-table .el-pagination .el-select{--el-select-font-size:13px}.ep-table .el-pagination .el-select .el-select__wrapper{font-size:13px}.ep-button{height:32px;padding:9px 15px}.ep-button.el-button--text{padding:0}.ep-button.el-button+.el-button{margin-left:10px}.ep-search-list-page #middle{overflow:hidden}.ep-search-list-page__middle-left{float:left}.ep-search-list-page__middle-left>.el-button{margin:16px 0}.ep-search-list-page__middle-right{float:right}.ep-search-list-page__middle-right .el-button{margin:16px 0}.ep-title{width:100%}.ep-title__header{line-height:50px;overflow:hidden}.ep-title__title{float:left;font-size:15px;font-weight:500}.ep-title__toggle{color:#409eff;cursor:pointer;display:inline-block;font-size:14px;font-weight:400;margin-left:10px;white-space:nowrap}.ep-title__toggle .el-icon{transition:transform .3s;vertical-align:-2px}.ep-title.is-expanded .ep-title__toggle .el-icon{transform:rotate(-180deg)}.ep-title__buttons{float:right}.ep-title__content{overflow:hidden;transition:max-height .3s ease-in-out}.ep-header{display:flex;flex-wrap:wrap}.ep-header>.el-button{margin-bottom:10px}.ep-header .el-page-header .el-page-header__left{margin-right:-10px;margin-top:4px}.ep-header .el-page-header .el-page-header__title{white-space:nowrap}.ep-template-promise{position:relative;z-index:8888888888888888}.ep-dialog{padding:20px 25px 30px}.ep-dialog .el-dialog__headerbtn{height:56px}.ep-dialog .el-dialog__headerbtn .el-dialog__close{transform:scale(1.3)}.ep-dialog .el-dialog__header{text-align:center}.ep-dialog .el-dialog__header .el-dialog__title{color:#505050;font-size:16px;font-weight:600;line-height:24px;margin:4px}.ep-dialog .el-dialog__body{padding:25px 0 0}.ep-dialog__footer button{font-size:12px}.ep-choose-dialog__selected-count{color:#409eff;float:left;font-size:16px;line-height:32px}.ep-confirm-dialog{padding-bottom:20px}.ep-confirm-dialog .ep-dialog__footer{padding-top:0}.ep-custom-column__dialog .el-dialog__body{text-align:center}.ep-custom-column__dialog .el-transfer{display:inline-block}.ep-custom-column__dialog .el-transfer-panel__footer{border-bottom:0;height:0}.ep-custom-column__dialog .el-transfer-panel{overflow:visible}.ep-custom-column__dialog .el-transfer__buttons button{width:100px}.ep-custom-column__dialog .el-transfer__buttons button span{font-size:13px}.ep-custom-column__operate{position:absolute;right:-100%;top:50%;transform:translate(calc(25% - 12px),32px)}.ep-custom-column__operate button{width:100px}.ep-custom-column__operate button span{font-size:13px}.no-cn__operate{transform:translate(calc(25% - 520px),32px)}.ep-link{font-size:13px}.ep-uni-vue{background:#fff}.ep-uni-vue__skeleton .el-skeleton__item{margin-top:10px}.ep-attachment__promise{width:100%}.ep-attachment__dialog--normal{background:none;position:static!important}.ep-attachment__dialog--normal .el-overlay-dialog{position:static}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog{margin:0;padding:0;width:auto!important}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog .el-dialog__header{display:none}.ep-attachment__dialog--normal .el-overlay-dialog .el-dialog .el-dialog__body{padding:0}.ep-attachment__handler{height:32px;padding:9px 15px}.ep-attachment__handler.el-button--text{padding:0}
|
|
@@ -2,53 +2,51 @@
|
|
|
2
2
|
@use 'common/var.scss' as *;
|
|
3
3
|
|
|
4
4
|
@include b(title) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
$parent: &;
|
|
6
|
+
width: 100%;
|
|
7
|
+
@include e(header) {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
line-height: 50px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@include e(title) {
|
|
13
|
+
font-size: 15px;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
float: left;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@include e(toggle) {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
color: $color-priamy;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
margin-left: 10px;
|
|
25
|
+
display: inline-block;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
|
|
28
|
+
.el-icon {
|
|
29
|
+
vertical-align: -2px;
|
|
30
|
+
transition: transform 0.3s;
|
|
16
31
|
}
|
|
32
|
+
}
|
|
17
33
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
color: $color-priamy;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
font-size: 14px;
|
|
24
|
-
margin-left: 10px;
|
|
25
|
-
display: inline-block;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
|
|
34
|
+
@include is(expanded) {
|
|
35
|
+
#{$parent} {
|
|
36
|
+
@include e(toggle) {
|
|
28
37
|
.el-icon {
|
|
29
|
-
|
|
30
|
-
transition: transform .3s;
|
|
38
|
+
transform: rotate(-180deg);
|
|
31
39
|
}
|
|
32
|
-
|
|
40
|
+
}
|
|
33
41
|
}
|
|
42
|
+
}
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.el-icon {
|
|
39
|
-
transform: rotate(-180deg);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@include e(buttons) {
|
|
46
|
-
float: right;
|
|
47
|
-
}
|
|
44
|
+
@include e(buttons) {
|
|
45
|
+
float: right;
|
|
46
|
+
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
48
|
+
@include e(content) {
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
transition: max-height 0.3s ease-in-out;
|
|
51
|
+
}
|
|
52
|
+
}
|
package/theme-chalk/table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ep-table__action-buttons{white-space:nowrap}.ep-table .el-table{font-size:13px}.ep-table .el-table .el-table__cell .is-edit{cursor:pointer}.ep-table .el-table .el-table__cell .is-edit:hover{color:#409eff}.ep-table .el-table .el-table__cell .is-edit .el-icon{vertical-align:-2px}.ep-table .el-table .el-table__cell.is-center .el-link{margin:0 auto;text-align:center}.ep-table .el-table .cell{line-height:30px}.ep-table .el-table thead tr th{height:42px}.ep-table .el-table thead tr th .cell{line-height:20px}.ep-table .el-table thead tr th .el-checkbox__inner{height:14px;width:14px}.ep-table .el-table td,.ep-table .el-table th{padding:3px 0}.ep-table .el-form-item__error{position:unset;text-align:left}.ep-table .el-form-item{margin-bottom:0}.ep-table .el-form-item .el-form-item__label{padding:0}.ep-table .el-pagination{margin-top:12px;--el-pagination-font-size:13px}.ep-table .el-pagination .el-select{--el-select-font-size:13px}.ep-table .el-pagination .el-select .el-select__wrapper{font-size:13px}
|
|
1
|
+
.ep-table{width:100%}.ep-table__action-buttons{white-space:nowrap}.ep-table .el-table{font-size:13px}.ep-table .el-table .el-table__cell .is-edit{cursor:pointer}.ep-table .el-table .el-table__cell .is-edit:hover{color:#409eff}.ep-table .el-table .el-table__cell .is-edit .el-icon{vertical-align:-2px}.ep-table .el-table .el-table__cell.is-center .el-link{margin:0 auto;text-align:center}.ep-table .el-table .cell{line-height:30px}.ep-table .el-table thead tr th{height:42px}.ep-table .el-table thead tr th .cell{line-height:20px}.ep-table .el-table thead tr th .el-checkbox__inner{height:14px;width:14px}.ep-table .el-table td,.ep-table .el-table th{padding:3px 0}.ep-table .el-form-item__error{position:unset;text-align:left}.ep-table .el-form-item{margin-bottom:0}.ep-table .el-form-item .el-form-item__label{padding:0}.ep-table .el-pagination{margin-top:12px;--el-pagination-font-size:13px}.ep-table .el-pagination .el-select{--el-select-font-size:13px}.ep-table .el-pagination .el-select .el-select__wrapper{font-size:13px}
|
package/theme-chalk/title.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ep-title__header{line-height:50px;overflow:hidden}.ep-title__title{float:left;font-size:15px;font-weight:500}.ep-title__toggle{color:#409eff;cursor:pointer;display:inline-block;font-size:14px;font-weight:400;margin-left:10px;white-space:nowrap}.ep-title__toggle .el-icon{transition:transform .3s;vertical-align:-2px}.ep-title.is-expanded .ep-title__toggle .el-icon{transform:rotate(-180deg)}.ep-title__buttons{float:right}.ep-title__content{overflow:hidden;transition:max-height .3s ease-in-out}
|
|
1
|
+
.ep-title{width:100%}.ep-title__header{line-height:50px;overflow:hidden}.ep-title__title{float:left;font-size:15px;font-weight:500}.ep-title__toggle{color:#409eff;cursor:pointer;display:inline-block;font-size:14px;font-weight:400;margin-left:10px;white-space:nowrap}.ep-title__toggle .el-icon{transition:transform .3s;vertical-align:-2px}.ep-title.is-expanded .ep-title__toggle .el-icon{transform:rotate(-180deg)}.ep-title__buttons{float:right}.ep-title__content{overflow:hidden;transition:max-height .3s ease-in-out}
|