newtv-ui-3.0 0.0.1

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.
Files changed (79) hide show
  1. package/README.md +55 -0
  2. package/lib/asserts/fonts/iconfont.539b8438.woff +0 -0
  3. package/lib/asserts/fonts/iconfont.5ee3b92b.ttf +0 -0
  4. package/lib/asserts/fonts/iconfont.b5b01d3e.woff2 +0 -0
  5. package/lib/asserts/img/gaoding.59d9deae.png +0 -0
  6. package/lib/asserts/img/zhihui.edef9d17.png +0 -0
  7. package/lib/demo.html +10 -0
  8. package/lib/newtv-ui-3.0.common.js +110261 -0
  9. package/lib/newtv-ui-3.0.css +1 -0
  10. package/lib/newtv-ui-3.0.umd.js +110271 -0
  11. package/lib/newtv-ui-3.0.umd.min.js +47 -0
  12. package/package.json +42 -0
  13. package/packages/assets/iconfont/iconfont.css +435 -0
  14. package/packages/assets/iconfont/iconfont.js +1 -0
  15. package/packages/assets/iconfont/iconfont.json +744 -0
  16. package/packages/assets/iconfont/iconfont.ttf +0 -0
  17. package/packages/assets/iconfont/iconfont.woff +0 -0
  18. package/packages/assets/iconfont/iconfont.woff2 +0 -0
  19. package/packages/assets/iconfont/iconfontSVG.js +1 -0
  20. package/packages/assets/images/bg.png +0 -0
  21. package/packages/assets/images/danger-bg.png +0 -0
  22. package/packages/assets/images/empty-bg.png +0 -0
  23. package/packages/assets/images/error-poster.png +0 -0
  24. package/packages/assets/images/error_img.png +0 -0
  25. package/packages/assets/images/logo.png +0 -0
  26. package/packages/assets/images/logo2.png +0 -0
  27. package/packages/assets/images/no_img.png +0 -0
  28. package/packages/assets/images/primary-bg.png +0 -0
  29. package/packages/assets/images/save.svg +3 -0
  30. package/packages/assets/images/state-Unpass.png +0 -0
  31. package/packages/assets/images/state-ing.png +0 -0
  32. package/packages/assets/images/state-ms.png +0 -0
  33. package/packages/assets/images/state-non.png +0 -0
  34. package/packages/assets/images/state-pass.png +0 -0
  35. package/packages/assets/images/success-bg.png +0 -0
  36. package/packages/assets/images/thumbnail-empty.png +0 -0
  37. package/packages/assets/images/versionIcon.png +0 -0
  38. package/packages/assets/images/warning-bg.png +0 -0
  39. package/packages/avatar-upload/index.js +10 -0
  40. package/packages/avatar-upload/src/error-poster.png +0 -0
  41. package/packages/avatar-upload/src/gaoding.png +0 -0
  42. package/packages/avatar-upload/src/previewDialog.vue +96 -0
  43. package/packages/avatar-upload/src/upload.vue +640 -0
  44. package/packages/avatar-upload/src/zhihui.png +0 -0
  45. package/packages/avatar-upload/src/zhihui_2.png +0 -0
  46. package/packages/cardTable/index.js +10 -0
  47. package/packages/cardTable/src/cardTable.vue +151 -0
  48. package/packages/form/index.js +10 -0
  49. package/packages/form/src/EllipsisTooltip.vue +31 -0
  50. package/packages/form/src/TextOverflow.vue +122 -0
  51. package/packages/form/src/form-item.vue +395 -0
  52. package/packages/form/src/form.js +46 -0
  53. package/packages/form/src/form.vue +233 -0
  54. package/packages/icon-tips/index.js +10 -0
  55. package/packages/icon-tips/src/icon-tips.vue +49 -0
  56. package/packages/index.js +49 -0
  57. package/packages/menu/index.js +10 -0
  58. package/packages/menu/src/menu.js +27 -0
  59. package/packages/menu/src/menu.vue +84 -0
  60. package/packages/menu/src/sub-item.vue +108 -0
  61. package/packages/pagination/index.js +10 -0
  62. package/packages/pagination/src/pagination.vue +134 -0
  63. package/packages/table/index.js +10 -0
  64. package/packages/table/src/table.vue +797 -0
  65. package/packages/tags/index.js +10 -0
  66. package/packages/tags/src/tag.vue +179 -0
  67. package/theme/pool_style.scss +598 -0
  68. package/theme/skyStyle/config.scss +19 -0
  69. package/theme/sky_style.scss +268 -0
  70. package/types/component.d.ts +7 -0
  71. package/types/dashboard.d.ts +10 -0
  72. package/types/form.d.ts +12 -0
  73. package/types/header.d.ts +10 -0
  74. package/types/index.d.ts +4 -0
  75. package/types/leftMenu.d.ts +14 -0
  76. package/types/list.d.ts +8 -0
  77. package/types/newtv-ui.d.ts +23 -0
  78. package/types/secondNav.d.ts +13 -0
  79. package/types/table.d.ts +14 -0
@@ -0,0 +1,46 @@
1
+ export const formProps = {
2
+ data: {
3
+ type: Array,
4
+ default: [],
5
+ },
6
+ form: {
7
+ type: Object,
8
+ default: () => {},
9
+ },
10
+ labelWidth: {
11
+ type: String,
12
+ default: '90px',
13
+ },
14
+ // 表单域标签的位置
15
+ labelPosition: {
16
+ type: String,
17
+ default: 'right',
18
+ },
19
+ inline: {
20
+ type: Boolean,
21
+ default: false,
22
+ },
23
+ column: {
24
+ type: Number,
25
+ default: 0,
26
+ },
27
+ edit: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ }
32
+
33
+ export const initTypeValue = {
34
+ input: '',
35
+ textarea: '',
36
+ select: '',
37
+ radio: '',
38
+ checkbox: [],
39
+ tag: [],
40
+ datePicker: '',
41
+ }
42
+
43
+ export default {
44
+ formProps,
45
+ initTypeValue,
46
+ }
@@ -0,0 +1,233 @@
1
+ <script>
2
+ import { defineComponent, reactive, ref, toRef, toRefs } from 'vue'
3
+ import { formProps, initTypeValue } from './form.js'
4
+ import FormItem from './form-item.vue'
5
+ export default defineComponent({
6
+ name: 'fgForm',
7
+ props: formProps,
8
+ components: { FormItem },
9
+ setup(__props, { emit }) {
10
+ const props = __props
11
+
12
+ const form = props.form
13
+
14
+ const rules = reactive({})
15
+
16
+ let formData = props.data
17
+
18
+ formData.forEach((item) => {
19
+ if (item.rules) {
20
+ rules[item.props] = item.rules
21
+ }
22
+ })
23
+ /* -------------- tagFn ./S -------------- */
24
+ const addTag = (key, tag) => {
25
+ let inputValueArr = tag.split(' ')
26
+ for (var i in inputValueArr) {
27
+ if (form[key].indexOf(inputValueArr[i]) == -1 && inputValueArr[i] !== '') {
28
+ form[key].push(inputValueArr[i])
29
+ }
30
+ }
31
+ // form[key].push(tag)
32
+ }
33
+
34
+ const deleteTag = (key, tag) => {
35
+ form[key].splice(form[key].indexOf(tag), 1)
36
+ emit('deleteTag', key, tag)
37
+ }
38
+
39
+ /* -------------- tagFn ./E -------------- */
40
+
41
+ /* -------------- 表单相关方法 ./S -------------- */
42
+ // 获取form值
43
+ const getFormDate = () => {
44
+ return form
45
+ }
46
+
47
+ const fgFormRef = ref(null)
48
+ // 表单验证
49
+ const validate = (cb) => {
50
+ fgFormRef.value.validate((valid) => {
51
+ if (valid) {
52
+ cb && cb(valid)
53
+ } else {
54
+ cb && cb(null)
55
+ }
56
+ })
57
+ }
58
+
59
+ // 单独表单验证
60
+ const validateField = (options, cb) => {
61
+ fgFormRef.value.validateField(options, (valid) => {
62
+ if (valid) {
63
+ cb && cb(valid)
64
+ } else {
65
+ cb && cb(false)
66
+ }
67
+ })
68
+ }
69
+
70
+ const resetFields = () => {
71
+ fgFormRef.value.resetFields()
72
+ }
73
+ const clearValidate = (data) => {
74
+ fgFormRef.value.clearValidate(data)
75
+ }
76
+ const handleChange = (val, prop, event) => {
77
+ emit('change', val, prop, event)
78
+ }
79
+ const selectRemoveTag = (val, prop) => {
80
+ emit('selectRemoveTag', val, prop)
81
+ }
82
+
83
+ /* -------------- 表单相关方法 ./E -------------- */
84
+
85
+ return {
86
+ inline: props.inline,
87
+ labelWidth: props.labelWidth,
88
+ labelPosition: props.labelPosition,
89
+ column: props.column,
90
+ edit: toRef(props, 'edit'),
91
+ form: toRef(props, 'form'),
92
+ rules,
93
+ formData,
94
+ addTag,
95
+ deleteTag,
96
+ getFormDate,
97
+ validate,
98
+ fgFormRef,
99
+ validateField,
100
+ handleChange,
101
+ resetFields,
102
+ selectRemoveTag,
103
+ clearValidate,
104
+ }
105
+ },
106
+ })
107
+ </script>
108
+
109
+ <template>
110
+ <el-form
111
+ ref="fgFormRef"
112
+ class="fg-form"
113
+ :class="{ 'view-form': edit }"
114
+ :inline="column > 0 ? false : inline"
115
+ :label-width="labelWidth"
116
+ :label-position="labelPosition"
117
+ :model="form"
118
+ :rules="rules"
119
+ :disabled="edit"
120
+ >
121
+ <el-row
122
+ :gutter="20"
123
+ v-if="column > 0"
124
+ >
125
+ <el-col
126
+ v-for="(item, key) in formData"
127
+ :key="`fgFormItem${key}`"
128
+ :span="item.span || 24 / column"
129
+ v-show="!item.isHide"
130
+ >
131
+ <slot v-if="item.type == 'split'">
132
+ <h6
133
+ class="form_split"
134
+ v-if="!item.template"
135
+ >{{ item.label }}</h6>
136
+ <div
137
+ class="form_split"
138
+ v-else
139
+ v-html="item.template"
140
+ ></div>
141
+ </slot>
142
+ <slot
143
+ v-else-if="item.type == 'slot'"
144
+ :name="item.props"
145
+ :item="item"
146
+ ></slot>
147
+ <form-item
148
+ v-else
149
+ :key="`fgFormItem${key}`"
150
+ :item="item"
151
+ :form="form"
152
+ :edit="edit"
153
+ @addTag="addTag"
154
+ @deleteTag="deleteTag"
155
+ @change="handleChange"
156
+ @selectRemoveTag="selectRemoveTag"
157
+ ></form-item>
158
+ </el-col>
159
+ </el-row>
160
+ <template v-else>
161
+ <template
162
+ v-for="(item, key) in formData"
163
+ :key="`fgFormItem${key}`"
164
+ >
165
+ <slot v-if="!item.isHide && item.type == 'split'">
166
+ <h6
167
+ class="form_split"
168
+ v-if="!item.template"
169
+ >{{ item.label }}</h6>
170
+ <div
171
+ class="form_split"
172
+ v-else
173
+ v-html="item.template"
174
+ ></div>
175
+ </slot>
176
+ <slot
177
+ v-else-if="!item.isHide && item.type == 'slot'"
178
+ :name="item.props"
179
+ :item="item"
180
+ ></slot>
181
+ <form-item
182
+ v-else-if="!item.isHide"
183
+ :item="item"
184
+ :key="`fgFormItem${key}`"
185
+ :form="form"
186
+ :edit="edit"
187
+ @addTag="addTag"
188
+ @deleteTag="deleteTag"
189
+ @change="handleChange"
190
+ @selectRemoveTag="selectRemoveTag"
191
+ ></form-item>
192
+ </template>
193
+ </template>
194
+ </el-form>
195
+ </template>
196
+
197
+ <style lang="scss">
198
+ .view-form {
199
+ .el-input.is-disabled .el-input__inner,
200
+ .el-textarea.is-disabled .el-textarea__inner,
201
+ .el-select .el-input.is-disabled .el-input__inner:hover,
202
+ .el-input.is-disabled .el-input__wrapper,
203
+ .el-input.is-disabled .el-input__wrapper:hover,
204
+ .el-select .el-input.is-disabled .el-input__wrapper:hover {
205
+ background: transparent;
206
+ box-shadow: none;
207
+ cursor: default;
208
+ }
209
+ .el-select .el-input.is-disabled .el-select__caret,
210
+ .el-form-item.is-required:not(.is-no-asterisk)
211
+ > .el-form-item__label-wrap
212
+ > .el-form-item__label:before,
213
+ .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before,
214
+ .el-input__prefix {
215
+ display: none;
216
+ }
217
+ .is-disabled.is-text {
218
+ padding: 8px 0 8px 11px;
219
+ margin-left: 0;
220
+ }
221
+ .el-button.is-disabled,
222
+ .el-button.is-disabled:focus,
223
+ .el-button.is-disabled:hover {
224
+ cursor: default;
225
+ }
226
+ .el-form-item {
227
+ margin-bottom: 0;
228
+ }
229
+ .el-form-item__label {
230
+ color: #74767a;
231
+ }
232
+ }
233
+ </style>
@@ -0,0 +1,10 @@
1
+ // 导入组件,组件必须声明 name
2
+ import fgIconTips from './src/icon-tips.vue'
3
+
4
+ // 为组件提供 install 安装方法,供按需引入
5
+ fgIconTips.install = function (Vue) {
6
+ Vue.component(fgIconTips.name, fgIconTips)
7
+ }
8
+
9
+ // 默认导出组件
10
+ export default fgIconTips
@@ -0,0 +1,49 @@
1
+ <script>
2
+ import { defineComponent, ref, nextTick, toRef, watch } from 'vue'
3
+ import { InfoFilled } from '@element-plus/icons-vue'
4
+ import { ElMessage } from 'element-plus'
5
+
6
+ export default defineComponent({
7
+ name: 'fgIconTips',
8
+ components: { InfoFilled },
9
+ props: {
10
+ iconTooltipContent: {
11
+ type: String,
12
+ default: '',
13
+ },
14
+ iconTooltipPlacement: {
15
+ type: String,
16
+ default: 'top',
17
+ },
18
+ iconTooltipEffect: {
19
+ type: String,
20
+ default: 'light',
21
+ },
22
+ rawContent: {
23
+ type: Boolean,
24
+ default: true,
25
+ },
26
+ },
27
+ })
28
+ </script>
29
+
30
+ <template>
31
+ <el-tooltip
32
+ class="fg-icon-tooltip"
33
+ :content="iconTooltipContent"
34
+ :placement="iconTooltipPlacement"
35
+ :effect="iconTooltipEffect"
36
+ :raw-content="rawContent"
37
+ >
38
+ <el-icon class="fg-icon-tip">
39
+ <InfoFilled />
40
+ </el-icon>
41
+ </el-tooltip>
42
+ </template>
43
+
44
+ <style scoped>
45
+ .fg-icon-tip.el-icon {
46
+ color: #fa983e;
47
+ margin-left: 5px;
48
+ }
49
+ </style>
@@ -0,0 +1,49 @@
1
+ import ElementPlus from 'element-plus'
2
+ import 'element-plus/dist/index.css'
3
+ import * as ElementPlusIconsVue from '@element-plus/icons-vue'
4
+ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
5
+
6
+ import './assets/iconfont/iconfont.css'
7
+
8
+ import fgMenu from './menu/src/menu.vue'
9
+ import fgTable from './table/src/table.vue'
10
+ import fgCard from './cardTable/src/cardTable.vue'
11
+ import fgPagination from './pagination/src/pagination.vue'
12
+ import fgForm from './form/src/form.vue'
13
+ import fgTag from './tags/src/tag.vue'
14
+ import fgAvatarUpload from './avatar-upload/src/upload.vue'
15
+ import fgIconTips from './icon-tips/src/icon-tips.vue'
16
+
17
+ const components = [fgMenu, fgForm, fgTable, fgCard, fgPagination, fgTag, fgAvatarUpload, fgIconTips]
18
+
19
+ const install = (app, options) => {
20
+ app.use(ElementPlus, { size: 'default', zIndex: 300, locale: zhCn })
21
+ // 判断是否安装
22
+ if (install.installed) return
23
+ // 遍历注册全局组件
24
+ components.map((component) => app.component(component.name, component))
25
+
26
+ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
27
+ app.component(key, component)
28
+ }
29
+ }
30
+
31
+ // 判断是否是直接引入文件
32
+ if (typeof window !== 'undefined' && window.Vue) {
33
+ install(window.Vue)
34
+ }
35
+
36
+ export default {
37
+ // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
38
+ install,
39
+ // 以下是具体的组件列表
40
+ fgMenu,
41
+ fgTable,
42
+ fgCard,
43
+ fgPagination,
44
+ fgForm,
45
+ fgTag,
46
+ fgAvatarUpload,
47
+ fgIconTips,
48
+ ...Object.values(ElementPlusIconsVue)
49
+ }
@@ -0,0 +1,10 @@
1
+ // 导入组件,组件必须声明 name
2
+ import fgMenu from './src/menu.vue'
3
+
4
+ // 为组件提供 install 安装方法,供按需引入
5
+ fgMenu.install = function (Vue) {
6
+ Vue.component(fgMenu.name, fgMenu)
7
+ }
8
+
9
+ // 默认导出组件
10
+ export default fgMenu
@@ -0,0 +1,27 @@
1
+ export const menuProps = {
2
+ menuList: {
3
+ type: Array,
4
+ default: [],
5
+ },
6
+ isCollapse: {
7
+ type: Boolean,
8
+ default: false,
9
+ },
10
+ active: {
11
+ type: String,
12
+ default: '/',
13
+ },
14
+ defaultOpeneds: {
15
+ type: [Array, Object],
16
+ default: null,
17
+ },
18
+ //我的工作台禁止折叠
19
+ isOpen: {
20
+ type: Boolean,
21
+ default: false,
22
+ },
23
+ }
24
+
25
+ export default {
26
+ menuProps,
27
+ }
@@ -0,0 +1,84 @@
1
+ <script>
2
+ import { defineComponent, reactive, toRef, watch, ref } from 'vue'
3
+ import { menuProps } from './menu.js'
4
+ import SubMenuItem from './sub-item.vue'
5
+
6
+ export default defineComponent({
7
+ name: 'fgMenu',
8
+ props: menuProps,
9
+ components: {
10
+ SubMenuItem,
11
+ },
12
+ setup(__props) {
13
+ const menus = ref(null)
14
+ const props = __props
15
+ // const state = reactive(props)
16
+
17
+ /* watch(props, (newData) => {
18
+ state.active = newData.active
19
+ }) */
20
+ const handleClose = (key, keyPath) => {
21
+ if (props.isOpen) {
22
+ menus.value.open(keyPath)
23
+ }
24
+ }
25
+ return {
26
+ menus,
27
+ handleClose,
28
+ menuList: __props.menuList,
29
+ active: toRef(props, 'active'),
30
+ isCollapse: toRef(props, 'isCollapse'),
31
+ defaultOpeneds: __props.defaultOpeneds,
32
+ isOpen: toRef(props, 'isOpen'),
33
+ }
34
+ },
35
+ })
36
+ </script>
37
+
38
+ <template>
39
+ <div class="fg-menu">
40
+ <slot name="title"></slot>
41
+ <div class="scroll">
42
+ <el-scrollbar>
43
+ <el-menu
44
+ :default-active="active"
45
+ :collapse="isCollapse"
46
+ :collapse-transition="false"
47
+ :default-openeds="defaultOpeneds"
48
+ router
49
+ ref="menus"
50
+ @close="handleClose"
51
+ >
52
+ <sub-menu-item
53
+ v-for="(item, index) in menuList"
54
+ :key="`menu${index}`"
55
+ :item="item"
56
+ :path="item.path"
57
+ />
58
+ </el-menu>
59
+ </el-scrollbar>
60
+ </div>
61
+ </div>
62
+ </template>
63
+
64
+ <style lang="scss">
65
+ .fg-menu {
66
+ height: 100%;
67
+ display: flex;
68
+ flex-direction: column;
69
+ .scroll {
70
+ flex: 1;
71
+ overflow: auto;
72
+ }
73
+ .el-menu {
74
+ border: 0;
75
+ }
76
+ .iconfont {
77
+ padding-right: 10px;
78
+ }
79
+ .mark * {
80
+ vertical-align: top;
81
+ margin-top: 3px;
82
+ }
83
+ }
84
+ </style>
@@ -0,0 +1,108 @@
1
+ <script>
2
+ import { defineComponent, reactive } from 'vue'
3
+
4
+ export default defineComponent({
5
+ name: 'subMenuItem',
6
+ props: {
7
+ path: {
8
+ type: String,
9
+ default: '',
10
+ },
11
+ item: {
12
+ type: Object,
13
+ default: () => {},
14
+ },
15
+ },
16
+ setup(__props, context) {
17
+ // 检测是否显示
18
+ const isHidden = (item) => {
19
+ if (item.hidden || (item.meta && item.meta.hidden)) {
20
+ return false
21
+ }
22
+ return true
23
+ }
24
+
25
+ // 检测是否存在子目录
26
+ const hasChildren = (children = [], parent) => {
27
+ const showingChildren = children.filter((item) => {
28
+ if (item.hidden) {
29
+ return false
30
+ } else {
31
+ return true
32
+ }
33
+ })
34
+
35
+ if (!parent.meta || (parent.meta && !parent.meta.title)) {
36
+ return true
37
+ }
38
+
39
+ if (showingChildren.length === 0) {
40
+ return true
41
+ }
42
+ return false
43
+ }
44
+
45
+ return {
46
+ isHidden,
47
+ hasChildren,
48
+ }
49
+ },
50
+ })
51
+ </script>
52
+
53
+ <template>
54
+ <el-sub-menu
55
+ v-if="!item.hidden && !hasChildren(item.children, item)"
56
+ :index="path"
57
+ >
58
+ <template #title>
59
+ <i
60
+ class="iconfont"
61
+ :class="item.icon"
62
+ ></i>
63
+ <span>
64
+ {{ item.meta && item.meta.title }}
65
+ </span>
66
+ <el-badge
67
+ v-if="item.mark"
68
+ class="mark"
69
+ :value="item.mark"
70
+ :max="99"
71
+ />
72
+ </template>
73
+
74
+ <template
75
+ v-for="child in item.children"
76
+ :key="child.path"
77
+ >
78
+ <sub-menu-item
79
+ v-if="!item.hidden"
80
+ :item="child"
81
+ :path="child.path"
82
+ />
83
+ </template>
84
+
85
+ </el-sub-menu>
86
+ <template v-else>
87
+ <el-menu-item
88
+ v-if="!item.hidden"
89
+ :index="path"
90
+ >
91
+ <i
92
+ class="iconfont"
93
+ :class="item.icon"
94
+ ></i>
95
+ <template #title>
96
+ <span>
97
+ {{ item.meta && item.meta.title }}
98
+ </span>
99
+ <el-badge
100
+ v-if="item.mark"
101
+ class="mark"
102
+ :value="item.mark"
103
+ :max="99"
104
+ />
105
+ </template>
106
+ </el-menu-item>
107
+ </template>
108
+ </template>
@@ -0,0 +1,10 @@
1
+ // 导入组件,组件必须声明 name
2
+ import fgPagination from './src/pagination.vue'
3
+
4
+ // 为组件提供 install 安装方法,供按需引入
5
+ fgPagination.install = function (Vue) {
6
+ Vue.component(fgPagination.name, fgPagination)
7
+ }
8
+
9
+ // 默认导出组件
10
+ export default fgPagination