zydx-plus 1.0.5 → 1.0.7

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,195 @@
1
+ /* 公历转农历代码思路:
2
+ 1、建立农历年份查询表
3
+ 2、计算输入公历日期与公历基准的相差天数
4
+ 3、从农历基准开始遍历农历查询表,计算自农历基准之后每一年的天数,并用相差天数依次相减,确定农历年份
5
+ 4、利用剩余相差天数以及农历每个月的天数确定农历月份
6
+ 5、利用剩余相差天数确定农历哪一天 */
7
+ var lunarYearTool = {
8
+ // 农历1949-2100年查询表
9
+ lunarYearArr: [
10
+ 0x0b557, //1949
11
+ 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, //1950-1959
12
+ 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, //1960-1969
13
+ 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, //1970-1979
14
+ 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, //1980-1989
15
+ 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, //1990-1999
16
+ 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, //2000-2009
17
+ 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, //2010-2019
18
+ 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, //2020-2029
19
+ 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, //2030-2039
20
+ 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, //2040-2049
21
+ 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, //2050-2059
22
+ 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, //2060-2069
23
+ 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, //2070-2079
24
+ 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, //2080-2089
25
+ 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, //2090-2099
26
+ 0x0d520 //2100
27
+ ],
28
+ lunarMonth: ['正', '二', '三', '四', '五', '六', '七', '八', '九', '十', '冬', '腊'],
29
+ lunarDay: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '初', '廿'],
30
+ tianGan: ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'],
31
+ diZhi: ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥'],
32
+ /**
33
+ * @description 公历转农历函数
34
+ * @param {int} sy 年份
35
+ * @param {int} sm 月份
36
+ * @param {int} sd 日期
37
+ * */
38
+ sloarToLunar: function(sy, sm, sd) { //
39
+ let that = this;
40
+ // 输入的月份减1处理
41
+ sm -= 1;
42
+
43
+ // 计算与公历基准的相差天数
44
+ // Date.UTC()返回的是距离公历1970年1月1日的毫秒数,传入的月份需要减1
45
+ let daySpan = (Date.UTC(sy, sm, sd) - Date.UTC(1949, 0, 29)) / (24 * 60 * 60 * 1000) + 1;
46
+ let ly, lm, ld;
47
+ // 确定输出的农历年份
48
+ for (let j = 0; j < that.lunarYearArr.length; j++) {
49
+ let tempDaySpan = that.lunarYearDays(that.lunarYearArr[j]);
50
+ daySpan -= tempDaySpan
51
+ if (daySpan <= 0) {
52
+ ly = 1949 + j;
53
+ // 获取农历年份确定后的剩余天数
54
+ daySpan += tempDaySpan;
55
+ break
56
+ }
57
+ }
58
+
59
+ // 确定输出的农历月份
60
+ let lunarYearMonthsList = that.lunarYearMonths(that.lunarYearArr[ly - 1949])
61
+ let hasLeapMonth_Result = that.hasLeapMonth(that.lunarYearArr[ly - 1949]);
62
+ for (let k = 0; k < lunarYearMonthsList.length; k++) {
63
+ daySpan -= lunarYearMonthsList[k];
64
+ if (daySpan <= 0) {
65
+ // 有闰月时,月份的数组长度会变成13,因此,当闰月月份小于等于k时,lm不需要加1
66
+ if (hasLeapMonth_Result && hasLeapMonth_Result <= k) {
67
+ if (hasLeapMonth_Result < k) {
68
+ lm = k;
69
+ } else if (hasLeapMonth_Result === k) {
70
+ lm = '闰' + k;
71
+ } else {
72
+ lm = k + 1;
73
+ }
74
+ } else {
75
+ lm = k + 1;
76
+ }
77
+ // 获取农历月份确定后的剩余天数
78
+ daySpan += lunarYearMonthsList[k];
79
+ break
80
+ }
81
+ }
82
+
83
+ // 确定输出农历哪一天
84
+ ld = daySpan;
85
+
86
+ // 将计算出来的农历月份转换成汉字月份,闰月需要在前面加上闰字
87
+ if (hasLeapMonth_Result && (typeof(lm) === 'string' && lm.indexOf('闰') > -1)) {
88
+ lm = `闰${this.lunarMonth[/\d/.exec(lm) - 1]}`
89
+ } else {
90
+ lm = that.lunarMonth[lm - 1];
91
+ }
92
+
93
+ // 将计算出来的农历年份转换为天干地支年
94
+ ly = that.getTianGan(ly) + that.getDiZhi(ly);
95
+
96
+ // 将计算出来的农历天数转换成汉字
97
+ if (ld < 11) {
98
+ ld = `${this.lunarDay[10]}${this.lunarDay[ld-1]}`
99
+ } else if (ld > 10 && ld < 20) {
100
+ ld = `${this.lunarDay[9]}${this.lunarDay[ld-11]}`
101
+ } else if (ld === 20) {
102
+ ld = `${this.lunarDay[1]}${this.lunarDay[9]}`
103
+ } else if (ld > 20 && ld < 30) {
104
+ ld = `${this.lunarDay[11]}${this.lunarDay[ld-21]}`
105
+ } else if (ld === 30) {
106
+ ld = `${this.lunarDay[2]}${this.lunarDay[9]}`
107
+ }
108
+
109
+ return {
110
+ lunarYear: ly,
111
+ lunarMonth: lm,
112
+ lunarDay: ld,
113
+ }
114
+ },
115
+ /**
116
+ * @description 计算农历年是否有闰月,参数为存储农历年的16进制
117
+ * 农历年份信息用16进制存储,其中16进制的最后1位可以用于判断是否有闰月
118
+ * */
119
+ hasLeapMonth: function(ly) {
120
+ // 获取16进制的最后1位,需要用到&与运算符
121
+ if (ly & 0xf) {
122
+ return ly & 0xf
123
+ } else {
124
+ return false
125
+ }
126
+ },
127
+ /**
128
+ * @description 如果有闰月,计算农历闰月天数,参数为存储农历年的16进制
129
+ * 农历年份信息用16进制存储,其中16进制的第1位(0x除外)可以用于表示闰月是大月还是小月
130
+ * */
131
+ leapMonthDays: function(ly) {
132
+ if (this.hasLeapMonth(ly)) {
133
+ // 获取16进制的第1位(0x除外)
134
+ return (ly & 0xf0000) ? 30 : 29
135
+ } else {
136
+ return 0
137
+ }
138
+ },
139
+ /**
140
+ * @description 计算农历一年的总天数,参数为存储农历年的16进制
141
+ * 农历年份信息用16进制存储,其中16进制的第2-4位(0x除外)可以用于表示正常月是大月还是小月
142
+ * */
143
+ lunarYearDays: function(ly) {
144
+ let totalDays = 0;
145
+
146
+ // 获取正常月的天数,并累加
147
+ // 获取16进制的第2-4位,需要用到>>移位运算符
148
+ for (let i = 0x8000; i > 0x8; i >>= 1) {
149
+ let monthDays = (ly & i) ? 30 : 29;
150
+ totalDays += monthDays;
151
+ }
152
+ // 如果有闰月,需要把闰月的天数加上
153
+ if (this.hasLeapMonth(ly)) {
154
+ totalDays += this.leapMonthDays(ly);
155
+ }
156
+
157
+ return totalDays
158
+ },
159
+ /**
160
+ * @description 获取农历每个月的天数 参数需传入16进制数值
161
+ * */
162
+ lunarYearMonths: function(ly) {
163
+ let monthArr = [];
164
+ let that = this;
165
+ // 获取正常月的天数,并添加到monthArr数组中
166
+ // 获取16进制的第2-4位,需要用到>>移位运算符
167
+ for (let i = 0x8000; i > 0x8; i >>= 1) {
168
+ monthArr.push((ly & i) ? 30 : 29);
169
+ }
170
+ // 如果有闰月,需要把闰月的天数加上
171
+ if (this.hasLeapMonth(ly)) {
172
+ monthArr.splice(this.hasLeapMonth(ly), 0, that.leapMonthDays(ly));
173
+ }
174
+
175
+ return monthArr
176
+ },
177
+ /**
178
+ * @description 将农历年转换为天干,参数为农历年
179
+ * */
180
+ getTianGan: function(ly) {
181
+ let tianGanKey = (ly - 3) % 10;
182
+ if (tianGanKey === 0) tianGanKey = 10;
183
+ return this.tianGan[tianGanKey - 1]
184
+ },
185
+ /**
186
+ * @description 将农历年转换为地支,参数为农历年
187
+ * */
188
+ getDiZhi: function(ly) {
189
+ let diZhiKey = (ly - 3) % 12;
190
+ if (diZhiKey === 0) diZhiKey = 12;
191
+ return this.diZhi[diZhiKey - 1]
192
+ }
193
+ }
194
+
195
+ export default lunarYearTool;
@@ -1,7 +1,35 @@
1
- import publicTable from './src/main';
1
+ import { createVNode, render } from 'vue'
2
+ import XtxConfirm from './src/main.vue'
2
3
 
3
- publicTable.install = function(Vue) {
4
- Vue.component(publicTable.name, publicTable);
5
- };
4
+ // 准备div容器
5
+ const divNode = createVNode('div', { class: 'xtx-confirm-container' })
6
+ render(divNode, document.body)
7
+ // 获取 DOM 节点, 用于挂载组件或卸载组件
8
+ const container = divNode.el
6
9
 
7
- export default publicTable;
10
+ // 导出函数可通过调用 Confirm() 函数动态创建 XtxConfirm 组件
11
+ const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr }) => {
12
+ // 返回 Promise 对象
13
+ return new Promise((resolve, reject) => {
14
+ // 2. 点击确认按钮,触发resolve同时销毁组件
15
+ const submit = () => {
16
+ let val = '点击确认'
17
+ if(type === 'input') {
18
+ val = inputArr.map(x => {
19
+ return x.value
20
+ })
21
+ }
22
+ render(null, container)
23
+ resolve(val)
24
+ }
25
+ // 3. 点击取消按钮,触发reject同时销毁组件
26
+ const cancel = () => {
27
+ render(null, container)
28
+ reject('点击取消')
29
+ }
30
+ // 1. 创建 XtxConfirm 组件
31
+ const VNode = createVNode(XtxConfirm, { type, url ,title, promptContent, middle, cancelShow, inputArr, submit, cancel })
32
+ render(VNode, container)
33
+ })
34
+ }
35
+ export default Confirm
@@ -11,6 +11,16 @@
11
11
  <div class="tip-img" v-if="type === 'img'">
12
12
  <img :src="url" />
13
13
  </div>
14
+ <div class="tip-img" v-if="type === 'input'">
15
+ <div class="tip-input" v-for="(item,index) in inputArr" :key="index">
16
+ <span>{{ item.name }}</span>
17
+ <input v-if="item.type === 'input'" type="text" :placeholder="item.placeholder" v-model="item.value" :disabled="item.disabled" />
18
+ <select v-if="item.type === 'select'" :disabled="item.disabled" v-model="item.value" :placeholder="item.placeholder">
19
+ <option value="1" v-for="(it,ind) in item.option" :key="ind">{{ it.name }}</option>
20
+ </select>
21
+ <div v-if="item.type === 'text'" class="text">{{ item.value }}</div>
22
+ </div>
23
+ </div>
14
24
  </div>
15
25
  </div>
16
26
  <div class="tip-btnBox">
@@ -46,21 +56,23 @@ export default {
46
56
  type: Boolean,
47
57
  default: true
48
58
  },
49
- cancelShow: {
59
+ cancelShow: { //是否显示取消按钮
50
60
  type: Boolean,
51
61
  default: true
52
- }
53
- },
54
- data () {
55
- return {}
56
- },
57
- methods: {
58
- submit: function (val) {
59
- this.$emit('rheResults', val)
60
62
  },
61
- cancel: function () {
62
- this.$emit('cancel')
63
- }
63
+ inputArr: { // 弹窗的提示标题
64
+ type: Array,
65
+ default: []
66
+ },
67
+ // 确认按钮
68
+ submit: {
69
+ type: Function,
70
+ default: () => {}
71
+ },
72
+ cancel: {
73
+ type: Function,
74
+ default: () => {}
75
+ },
64
76
  }
65
77
  }
66
78
  </script>
@@ -16,6 +16,7 @@
16
16
  border-radius: 5px;
17
17
  border: 5px rgba(0, 0, 0, .1) solid;
18
18
  margin: 0 auto;
19
+ box-sizing: border-box;
19
20
  }
20
21
  .tip-boxContent{
21
22
  max-height: 600px;
@@ -79,9 +80,47 @@ font-size: 12px;
79
80
  text-align: center;
80
81
  }
81
82
  .tip-img{
82
- width: 70%;
83
+ width: 100%;
83
84
  display: inline-block;
84
85
  }
85
86
  .tip-img>img{
86
87
  width: 100%;
87
88
  }
89
+ .tip-input{
90
+ display: inline-block;
91
+ padding-bottom: 15px;
92
+ }
93
+ .tip-input:last-child{
94
+ padding-bottom: 0;
95
+ }
96
+ .tip-input>span{
97
+ font-size: 16px;
98
+ font-weight: bold;
99
+ display: inline-block;
100
+ line-height: 30px;
101
+ padding-right: 10px;
102
+ }
103
+ .tip-input>input{
104
+ width: 210px;
105
+ height: 30px;
106
+ box-sizing: border-box;
107
+ font-size: 16px;
108
+ outline: none;
109
+ padding-left: 10px;
110
+ border: 1px solid #ccc;
111
+ }
112
+ .tip-input>select{
113
+ width: 210px;
114
+ height: 30px;
115
+ box-sizing: border-box;
116
+ font-size: 16px;
117
+ outline: none;
118
+ padding-left: 10px;
119
+ border: 1px solid #ccc;
120
+ }
121
+ .text{
122
+ display: inline-block;
123
+ font-size: 16px;
124
+ width: 210px;
125
+ text-align: left;
126
+ }
package/src/index.js CHANGED
@@ -1,24 +1,20 @@
1
1
  import tipBox from './components/tipBox/index';
2
- import menuTree from './components/menuTree/index';
2
+ import Calendar from './components/calendar/index';
3
3
 
4
4
  const components = [
5
- tipBox,
6
- menuTree
5
+ Calendar
7
6
  ];
8
7
 
9
- const install = function(Vue, opts = {}) {
8
+ function install(app) {
10
9
  components.forEach(component => {
11
- Vue.component(component.name, component);
10
+ app.component(component.name, component);
12
11
  });
13
- };
14
-
15
- if (typeof window !== 'undefined' && window.Vue) {
16
- install(window.Vue);
12
+ app.config.globalProperties.$message = tipBox
17
13
  }
18
14
 
19
15
  export default {
20
- version: '1.0.5',
16
+ version: '1.0.7',
21
17
  install,
22
- tipBox,
23
- menuTree
18
+ Calendar
24
19
  };
20
+
@@ -1,7 +0,0 @@
1
- import menuTree from './src/ZydxMenuTree.vue';
2
-
3
- menuTree.install = function(Vue) {
4
- Vue.component(menuTree.name, menuTree);
5
- };
6
-
7
- export default menuTree;
@@ -1,135 +0,0 @@
1
- <template>
2
- <div class="menuTree">
3
- <slot></slot>
4
- <div v-for="(item, index) in targetTree" :key="index">
5
- <zydx-menu-tree-info
6
- :nodeSet="nodeSet"
7
- :isShowLine="isShowLine"
8
- :isShowUpDown="isShowUpDown"
9
- :menu-info="item"
10
- :selectItem="selectItem"
11
- @clickItem="clickItem"
12
- ></zydx-menu-tree-info>
13
- </div>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- import zydxMenuTreeInfo from "./ZydxMenuTreeInfo";
19
- export default {
20
- name: "zydx-menu-tree",
21
- components: {
22
- zydxMenuTreeInfo,
23
- },
24
- props: {
25
- // 是否显示展开收起动作
26
- isShowUpDown: {
27
- type: Boolean,
28
- default: false,
29
- },
30
- // 是否显示底线
31
- isShowLine: {
32
- type: Boolean,
33
- default: false,
34
- },
35
- // 节点设置
36
- nodeSet: {
37
- type: Number,
38
- default: 2,
39
- },
40
- // 选择当前的节点
41
- selectItem: {
42
- type: Object,
43
- default: function () {
44
- return {};
45
- },
46
- },
47
- // 树数据
48
- treeData: {
49
- type: Array,
50
- required: true,
51
- },
52
- },
53
- computed: {
54
- targetTree: function () {
55
- let that = this;
56
- let targetTree = [];
57
- let minLevel = "";
58
- that.treeData.map(function (item) {
59
- if (that.isShowUpDown) {
60
- // 如果设置收起展开, 添加控制变量
61
- that.$set(item, "isShowUpDown", false);
62
- } else {
63
- that.$set(item, "isShowUpDown", true);
64
- }
65
- if (minLevel === "") {
66
- minLevel = item.level;
67
- } else {
68
- if (item.level < minLevel) {
69
- minLevel = item.level;
70
- }
71
- }
72
- });
73
- this.treeData.map(function (item) {
74
- if (item.level === minLevel) {
75
- targetTree.push(item);
76
- }
77
- });
78
- targetTree.map(function (item) {
79
- that.forArr(that.treeData, item);
80
- });
81
- if (that.isShowUpDown) {
82
- for (let i = 0; i < targetTree.length; i++) {
83
- this.setIsShowUpDown(targetTree[i], i);
84
- }
85
- }
86
- return targetTree;
87
- },
88
- },
89
- methods: {
90
- // 原始目录树转换方法
91
- forArr: function (arr, obj) {
92
- let that = this;
93
- let newArr = [];
94
- arr.map(function (item) {
95
- if (item.pcatalogId === obj.catalogId) {
96
- newArr.push(item);
97
- }
98
- });
99
- if (newArr.length === 0) {
100
- return false;
101
- }
102
- obj.children = newArr;
103
- newArr.map(function (item) {
104
- that.forArr(arr, item);
105
- });
106
- },
107
- // 点击回调事件
108
- clickItem(item) {
109
- this.$emit("clickItem", item);
110
- },
111
- // 递归调用修改状态
112
- setIsShowUpDown(item, index) {
113
- if (index === 0) {
114
- let children = item.children;
115
- if (children && children.length !== 0) {
116
- this.$set(item, "isShowUpDown", true);
117
- for (let i = 0; i < children.length; i++) {
118
- this.setIsShowUpDown(children[i], i);
119
- }
120
- }
121
- }
122
- },
123
- },
124
- };
125
- </script>
126
-
127
- <style scoped>
128
- .menuTree {
129
- overflow: hidden;
130
- white-space: nowrap;
131
- text-overflow: ellipsis;
132
- padding: 0px 10px;
133
- }
134
-
135
- </style>
@@ -1,163 +0,0 @@
1
- /**
2
- * @开发者: zmy
3
- * @描述: 目录树通用组件
4
- * @创建时间: 2022-08-16 11:00:00
5
- * @内容:
6
- 必传值:名字/类型/默认值/作用
7
- menuInfo 目录树数据
8
- 非必传值:
9
- nodeSet 传入当前的节点设置, 小于当前节点设置不可点,灰色
10
- selectItem 传入当前选择的节点,是一个对象
11
- * @回调事件:
12
- * clickItem 点击点前节点的回调, 返回点击的节点
13
- @组件内方法:
14
- */
15
- <template>
16
- <div>
17
- <div
18
- class="lineHeight30"
19
- :class="menuInfo.level === 0 ? '' : 'marginLeft14'"
20
- >
21
- <div
22
- style="display: flex; flex-direction: row"
23
- :style="this.isShowLine ? 'border-bottom: 1px #CCCCCC dashed;' : ''"
24
- >
25
- <div
26
- class="widthB100 ellipse cursor"
27
- :class="menuTitleStyle"
28
- @click.stop="clickItem(menuInfo)"
29
- >
30
- {{ menuInfo.title }}
31
- </div>
32
- <div v-show="isShowUpDown && menuInfo.children">
33
- <span
34
- class="iconfont"
35
- v-html="defaultFont"
36
- @click="clickFont(menuInfo)"
37
- ></span>
38
- </div>
39
- </div>
40
- <div v-show="menuInfo.isShowUpDown">
41
- <div v-for="(item, index) in menuInfo.children" :key="index">
42
- <zydx-menu-tree-info
43
- :isShowUpDown="isShowUpDown"
44
- :isShowLine="isShowLine"
45
- :selectItem="selectItem"
46
- :menu-info="item"
47
- :nodeSet="nodeSet"
48
- @clickItem="clickItem"
49
- >
50
- </zydx-menu-tree-info>
51
- </div>
52
- </div>
53
- </div>
54
- </div>
55
- </template>
56
-
57
- <script>
58
- import zydxMenuTreeInfo from "./ZydxMenuTreeInfo";
59
- export default {
60
- name: "zydx-menu-tree-info",
61
- components: {
62
- zydxMenuTreeInfo,
63
- },
64
- props: {
65
- // 是否显示展开收起动作
66
- isShowUpDown: {
67
- type: Boolean,
68
- default: false,
69
- },
70
- // 是否显示底线
71
- isShowLine: {
72
- type: Boolean,
73
- default: false,
74
- },
75
- // 节点等级设置
76
- nodeSet: {
77
- type: Number,
78
- required: true,
79
- },
80
- // 选择当前的节点
81
- selectItem: {
82
- type: Object,
83
- default: function () {
84
- return {};
85
- },
86
- },
87
- // 树数据
88
- menuInfo: {
89
- type: Object,
90
- required: true,
91
- },
92
- },
93
- computed: {
94
- defaultFont() {
95
- if (this.menuInfo.isShowUpDown) {
96
- return "&#xeaf5;";
97
- }
98
- return "&#xeaf3;";
99
- },
100
- menuTitleStyle() {
101
- let ar = [];
102
- console.log(this.nodeSet);
103
- if (parseInt(this.menuInfo.level) > parseInt(this.nodeSet)) {
104
- ar.push("disable");
105
- }
106
- if (this.selectItem === this.menuInfo) {
107
- ar.push("active");
108
- }
109
- return ar;
110
- },
111
- },
112
- methods: {
113
- clickItem(item) {
114
- this.$emit("clickItem", item);
115
- },
116
- clickFont(item) {
117
- item.isShowUpDown = !item.isShowUpDown;
118
- // if (item.isShowUpDown) {
119
- // this.defaultFont = '&#xeaf5;'
120
- // } else {
121
- // this.defaultFont = '&#xeaf3;'
122
- // }
123
- },
124
- },
125
- };
126
- </script>
127
-
128
- <style scoped>
129
- @font-face {
130
- font-family: "iconfont";
131
- src: url("iconfont.ttf?t=1660878683989") format("truetype");
132
- }
133
- .iconfont {
134
- font-family: "iconfont" !important;
135
- font-size: 16px;
136
- font-style: normal;
137
- -webkit-font-smoothing: antialiased;
138
- -moz-osx-font-smoothing: grayscale;
139
- cursor: pointer;
140
- }
141
- .cursor {
142
- cursor: pointer;
143
- }
144
- .disable {
145
- color: #7c7c7c;
146
- pointer-events: none;
147
- cursor: default;
148
- }
149
- .border_bottom {
150
- border-bottom: 1px #cccccc dashed;
151
- }
152
- .active {
153
- color: #00ff00;
154
- }
155
- .ellipse {
156
- text-overflow: ellipsis;
157
- white-space: nowrap;
158
- overflow: hidden;
159
- }
160
- .marginLeft14 {
161
- margin-left: 14px;
162
- }
163
- </style>