zydx-plus 1.19.86 → 1.19.88

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.19.86",
3
+ "version": "1.19.88",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -17,23 +17,31 @@
17
17
  <div v-for="(item, index) in nodeList" :key="index" class="borderBottom1cccccc padding0_10">
18
18
  <zydx-topic-dry>
19
19
  <template v-slot:title_slot><span class="fontSize16">{{item.name}}</span></template>
20
- <template v-slot:button_slot v-show="isShowBtn">
20
+ <template v-slot:button_slot v-if="isShowBtn">
21
21
  <template v-for="(buttonInfo, buttonIndex) in initConfig(item).buttonList[tabType]">
22
- <template v-if="buttonInfo instanceof Object">
23
- <!-- 我是在课级节点上渲染的 -->
24
- <button class="z-button" :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''" v-if="item.level === 0 && (buttonIndex === 'prefixLevel0btn' || buttonIndex === 'suffixLevel0btn')" v-for="(childButtonInfo, childButtonIndex) in buttonInfo" @click="clickRightBtn(item, childButtonIndex, childButtonInfo)">
22
+ <template v-if="buttonInfo instanceof Object" v-for="(childButtonInfo, childButtonIndex) in buttonInfo">
23
+ <!-- 在课上渲染的 -->
24
+ <button class="z-button"
25
+ :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''"
26
+ v-if="item.level === 0 && buttonIndex === 'headLevel' && childButtonIndex !== 'default'"
27
+ @click="clickRightBtn(item, childButtonIndex, childButtonInfo)"
28
+ >
25
29
  {{childButtonInfo}}
26
30
  </button>
27
- <!-- 我是在最低节点渲染的 -->
28
- <button class="z-button" :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''" v-if="item.level !== 0 && item.children && item.children.length !== 0 && buttonIndex === 'otherThanLevel0'" v-for="(childButtonInfo, childButtonIndex) in buttonInfo" @click="clickRightBtn(item, childButtonIndex, childButtonInfo)">
29
- {{childButtonInfo}}
30
- </button>
31
- <!-- 除课级标题以外的 -->
32
- <button class="z-button" :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''" v-if="item.level !== 0 && buttonIndex === 'levelOtherBtn'" v-for="(childButtonInfo, childButtonIndex) in buttonInfo" @click="clickRightBtn(item, childButtonIndex, childButtonInfo)">
31
+ <!-- 单独在最低节点设置的按钮 -->
32
+ <button class="z-button"
33
+ :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''"
34
+ v-if="item.level !== 0 && (!item.children || item.children.length === 0) && buttonIndex === 'lowLevel' && childButtonIndex !== 'default'"
35
+ @click="clickRightBtn(item, childButtonIndex, childButtonInfo)"
36
+ >
33
37
  {{childButtonInfo}}
34
38
  </button>
35
- <!-- 单独在最低节点设置的按钮 -->
36
- <button class="z-button" :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''" v-if="item.level !== 0 && (!item.children || item.children.length === 0) && buttonIndex === 'lowLevel'" v-for="(childButtonInfo, childButtonIndex) in buttonInfo" @click="clickRightBtn(item, childButtonIndex, childButtonInfo)">
39
+ <!-- 在非课和非最低节点 -->
40
+ <button class="z-button"
41
+ :class="childButtonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''"
42
+ v-if="item.level !== 0 && item.children && item.children.length !== 0 && buttonIndex === 'otherLevel' && childButtonIndex !== 'default'"
43
+ @click="clickRightBtn(item, childButtonIndex, childButtonInfo)"
44
+ >
37
45
  {{childButtonInfo}}
38
46
  </button>
39
47
  </template>
@@ -58,14 +66,12 @@ export default {
58
66
  props: {
59
67
  actionId: {
60
68
  type: String,
61
- default: "action_checktime"
69
+ required: true
62
70
  },
63
71
  // 选中的节点
64
72
  selectItem: {
65
73
  type: Object,
66
- default () {
67
- return {}
68
- }
74
+ required: true
69
75
  },
70
76
  // 班级还是个人
71
77
  tabType: {
@@ -85,34 +91,36 @@ export default {
85
91
  // 目录树集合
86
92
  catalogList: {
87
93
  type: Array,
88
- default: function () {
89
- return []
90
- }
94
+ required: true
91
95
  },
92
96
  // 0动作或者1资源或者2学生端
93
97
  headerType: {
94
98
  type: Number,
95
- default: 0
99
+ required: true
96
100
  }
97
101
  },
98
102
  data() {
99
103
  return {
100
- nodeList: [],
101
- buttonInfo: {}
104
+ nodeList: []
102
105
  }
103
106
  },
104
107
  computed: {
105
108
  getSelectBtnIndex () {
106
109
  if (this.selectBtnIndex === '') {
107
110
  let buttonIndex = '';
108
- if (this.selectItem.level == 0 && this.tabType === 0) {
109
- buttonIndex = 'demand';
111
+ let buttonList = this.initConfig(this.selectItem).buttonList[this.tabType];
112
+ if (this.selectItem.level === 0 && buttonList.headLevel) {
113
+ buttonIndex = buttonList.headLevel.default;
114
+ this.clickRightBtn(this.selectItem, buttonIndex, buttonList.headLevel[buttonIndex]);
115
+ } else if(this.selectItem.level != 0 && (!this.selectItem.children || this.selectItem.children.length === 0) && buttonList.lowLevel) {
116
+ buttonIndex = buttonList.lowLevel.default;
117
+ this.clickRightBtn(this.selectItem, buttonIndex, buttonList.lowLevel[buttonIndex]);
110
118
  } else {
111
- buttonIndex = 'btnIndex1';
119
+ if (buttonList.otherLevel) {
120
+ buttonIndex = buttonList.otherLevel.default;
121
+ this.clickRightBtn(this.selectItem, buttonIndex, buttonList.otherLevel[buttonIndex]);
122
+ }
112
123
  }
113
- // 获取按钮名称
114
- this.queryKey(this.initConfig(this.selectItem).buttonList[this.tabType])
115
- this.clickRightBtn(this.selectItem, buttonIndex, this.buttonInfo[buttonIndex]);
116
124
  return buttonIndex;
117
125
  } else {
118
126
  return this.selectBtnIndex;
@@ -166,17 +174,6 @@ export default {
166
174
  clickRightBtn (selectItem, selectBtnIndex, selectBtnName) {
167
175
  this.$emit('clickRightBtn', {selectItem, selectBtnIndex, selectBtnName, 'nodeList': this.nodeList})
168
176
  },
169
- // 通过递归获取对象所有key
170
- queryKey(obj) {
171
- for(let key in obj){
172
- // 判断子节点是否为对象,是的话则递归,最后为键值对而不是对象则跳出
173
- if(obj[key] instanceof Object){
174
- this.queryKey(obj[key])
175
- } else {
176
- this.buttonInfo = {...this.buttonInfo,...obj}
177
- }
178
- }
179
- }
180
177
  },
181
178
  components: {zydxTopicDry}
182
179
  }