ylwl-cpscoms 1.1.0 → 1.2.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.
- package/package.json +2 -3
- package/src/DtTable/DtTable/347/273/204/344/273/266/344/275/277/347/224/250/346/226/207/346/241/243.md +0 -819
- package/src/DtTable/index.vue +0 -779
- package/src/SlAlert/SlAlert.stories.js +0 -108
- package/src/SlAlert/index.vue +0 -55
- package/src/SlAlert/remark.md +0 -16
- package/src/SlDescriptions/SlDescriptions.stories.js +0 -119
- package/src/SlDescriptions/index.vue +0 -60
- package/src/SlDescriptions/renderOptions.vue +0 -27
- package/src/SlDialog/README-PLUS.md +0 -74
- package/src/SlDialog/README.md +0 -114
- package/src/SlDialog/dialogPlus.js +0 -160
- package/src/SlDialog/index.js +0 -170
- package/src/SlDrawer/SlDrawer.stories.js +0 -154
- package/src/SlDrawer/index.js +0 -62
- package/src/SlForm/SlForm.stories.js +0 -120
- package/src/SlForm/index.vue +0 -506
- package/src/SlForm/mixinRender.js +0 -228
- package/src/SlForm/otherItem/titleItem.vue +0 -31
- package/src/SlForm/remark.md +0 -607
- package/src/SlGuide/SlGuide.stories.js +0 -100
- package/src/SlGuide/index.vue +0 -166
- package/src/SlGuide/remark.md +0 -90
- package/src/SlMessageBox/index.js +0 -35
- package/src/SlPage/README.md +0 -515
- package/src/SlPage/SlPage.stories.js +0 -125
- package/src/SlPage/index.vue +0 -303
- package/src/SlPage/remark.md +0 -283
- package/src/SlTable/SlTable.stories.js +0 -118
- package/src/SlTable/components/colSetting.vue +0 -86
- package/src/SlTable/index.vue +0 -541
- package/src/SlTitle/SlTitle.stories.js +0 -98
- package/src/SlTitle/index.vue +0 -49
- package/src/global.css +0 -5
- package/src/index.js +0 -49
- package/src/store/index.js +0 -20
- package/src/utils/index.js +0 -47
- package/src/utils/tableConfig.js +0 -33
package/src/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// CPSB Component Library Entry Point
|
|
2
|
-
// Supports Vue.use() global registration and named imports
|
|
3
|
-
|
|
4
|
-
import SlAlert from './SlAlert/index.vue'
|
|
5
|
-
import SlDescriptions from './SlDescriptions/index.vue'
|
|
6
|
-
import SlForm from './SlForm/index.vue'
|
|
7
|
-
import SlGuide from './SlGuide/index.vue'
|
|
8
|
-
import SlPage from './SlPage/index.vue'
|
|
9
|
-
import SlTable from './SlTable/index.vue'
|
|
10
|
-
import SlTitle from './SlTitle/index.vue'
|
|
11
|
-
import DtTable from './DtTable/index.vue'
|
|
12
|
-
|
|
13
|
-
export { createCommandDialog } from './SlDialog/index.js'
|
|
14
|
-
export { createCommandDialogPlus } from './SlDialog/dialogPlus.js'
|
|
15
|
-
export { createCommandDrawer } from './SlDrawer/index.js'
|
|
16
|
-
export { showConfirmMessageBox } from './SlMessageBox/index.js'
|
|
17
|
-
|
|
18
|
-
export * from './utils/index.js'
|
|
19
|
-
|
|
20
|
-
const components = {
|
|
21
|
-
SlAlert,
|
|
22
|
-
SlDescriptions,
|
|
23
|
-
SlForm,
|
|
24
|
-
SlGuide,
|
|
25
|
-
SlPage,
|
|
26
|
-
SlTable,
|
|
27
|
-
SlTitle,
|
|
28
|
-
DtTable
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function install(Vue, options = {}) {
|
|
32
|
-
if (install.installed) return
|
|
33
|
-
install.installed = true
|
|
34
|
-
|
|
35
|
-
Object.keys(components).forEach(name => {
|
|
36
|
-
Vue.component(name, components[name])
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (typeof window !== 'undefined' && window.Vue) {
|
|
41
|
-
window.Vue.use(install)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { SlAlert, SlDescriptions, SlForm, SlGuide, SlPage, SlTable, SlTitle }
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
install,
|
|
48
|
-
version: '1.0.0'
|
|
49
|
-
}
|
package/src/store/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// SlPage 组件的 store 适配层,底层使用 localStorage 存取列配置
|
|
2
|
-
import { getColConfig, saveColConfig, getAllColConfig } from '@/components/global/utils/tableConfig'
|
|
3
|
-
|
|
4
|
-
const store = {
|
|
5
|
-
state: {
|
|
6
|
-
tableConfig: {
|
|
7
|
-
get colConfig() {
|
|
8
|
-
return getAllColConfig()
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
dispatch(action, payload) {
|
|
13
|
-
if (action === 'saveStorageCustomCol') {
|
|
14
|
-
saveColConfig(payload.key, payload.type, payload.value)
|
|
15
|
-
}
|
|
16
|
-
// getStorageCustomCol 无需操作,computed 中直接读取 state.tableConfig.colConfig
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default store
|
package/src/utils/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import CryptoJS from 'crypto-js'
|
|
2
|
-
export function typeOf(fn, type) {
|
|
3
|
-
return typeof fn === type
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export function hasKey(obj, keys) {
|
|
7
|
-
if (!Array.isArray(keys) && typeOf(keys, 'string')) {
|
|
8
|
-
return obj.hasOwnProperty(keys)
|
|
9
|
-
}
|
|
10
|
-
return keys.every(key => obj.hasOwnProperty(key))
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function filterKey(obj = {}, fiterAry = []) {
|
|
14
|
-
return Object.keys(obj)
|
|
15
|
-
.filter((key) => !fiterAry.includes(key))
|
|
16
|
-
.reduce((pre, key) => {
|
|
17
|
-
pre[key] = obj[key]
|
|
18
|
-
return pre
|
|
19
|
-
}, {})
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function transformName(str) {
|
|
23
|
-
return str.split('-').reduce((pre, word) => {
|
|
24
|
-
pre += word.slice(0, 1).toUpperCase() + word.slice(1)
|
|
25
|
-
return pre
|
|
26
|
-
}, '')
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function generateUniqueId(input) {
|
|
30
|
-
try {
|
|
31
|
-
const hash = CryptoJS.SHA256(input)
|
|
32
|
-
return hash.toString(CryptoJS.enc.Base64)
|
|
33
|
-
} catch (error) {
|
|
34
|
-
throw new Error('生成唯一字符失败')
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function getValueByPath(obj, path) {
|
|
39
|
-
if (typeof path === 'string') {
|
|
40
|
-
path = path.split(',')
|
|
41
|
-
}
|
|
42
|
-
return path.reduce((acc, key) => acc && acc[key], obj)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function isMobileDevice() {
|
|
46
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
47
|
-
}
|
package/src/utils/tableConfig.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// 表格列配置的 localStorage 存取工具
|
|
2
|
-
|
|
3
|
-
const STORAGE_KEY = 'colConfig'
|
|
4
|
-
|
|
5
|
-
function readAll() {
|
|
6
|
-
try {
|
|
7
|
-
return JSON.parse(localStorage.getItem(STORAGE_KEY)) || {}
|
|
8
|
-
} catch (e) {
|
|
9
|
-
return {}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function writeAll(data) {
|
|
14
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(data))
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function getColConfig(key) {
|
|
18
|
-
const all = readAll()
|
|
19
|
-
return all[key] || {}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function saveColConfig(key, type, value) {
|
|
23
|
-
const all = readAll()
|
|
24
|
-
if (!all[key]) {
|
|
25
|
-
all[key] = {}
|
|
26
|
-
}
|
|
27
|
-
all[key][type] = value
|
|
28
|
-
writeAll(all)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function getAllColConfig() {
|
|
32
|
-
return readAll()
|
|
33
|
-
}
|