zydx-plus 1.13.56 → 1.15.57

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.13.56",
3
+ "version": "1.15.57",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -27,8 +27,9 @@
27
27
  "@wangeditor/plugin-upload-attachment": "^1.1.0",
28
28
  "snabbdom": "^3.5.1",
29
29
  "@wangeditor/plugin-formula": "^1.0.11",
30
- "katex": "^0.16.6",
31
- "simple-mind-map": "^0.5.5"
30
+ "katex": "^0.15.6",
31
+ "simple-mind-map": "^0.5.8",
32
+ "html2json": "^1.0.2"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "vue": "^3.2.13"
@@ -0,0 +1,6 @@
1
+ import main from './src/bizHeader.vue';
2
+
3
+ main.install = function(Vue) {
4
+ Vue.component(main.name, main);
5
+ };
6
+ export default main;
@@ -0,0 +1,200 @@
1
+ /**
2
+ * @描述: 动作资源统一右侧header
3
+ * @创建时间: 2023-05-05 11:19:00
4
+ * @内容:
5
+ * @必传值:名字/类型/默认值/作用
6
+ * @非必传值:actionId: 动作ID
7
+ selectItem: 选中节点
8
+ tabType: 0班级 2 个人
9
+ selectBtnIndex: 选中按钮标识
10
+ catalogList: 目录集合。 需要带 children
11
+ headerType: 0动作或者1资源或者2学生端
12
+ * @回调事件:clickRightBtn: 按钮点击事件 回参有 选中节点,选中标识,当前点击节点结合
13
+ * @组件内方法:
14
+ */
15
+ <template>
16
+ <div class="headLevel">
17
+ <div v-for="(item, index) in nodeList" :key="index" class="borderBottom1cccccc padding0_10">
18
+ <zydx-topic-dry>
19
+ <template v-slot:title_slot><span class="fontSize16">{{item.name}}</span></template>
20
+ <template v-slot:button_slot v-show="isShowBtn">
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)">
25
+ {{childButtonInfo}}
26
+ </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)">
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)">
33
+ {{childButtonInfo}}
34
+ </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)">
37
+ {{childButtonInfo}}
38
+ </button>
39
+ </template>
40
+ <template v-else-if="buttonInfo != null && buttonInfo.constructor === String">
41
+ <button class="z-button" :class="buttonIndex === getSelectBtnIndex && selectItem.level === item.level? 'active' : ''" v-if="buttonIndex !== 'level0btn' && buttonInfo != null" @click="clickRightBtn(item, buttonIndex)">
42
+ {{buttonInfo}}
43
+ </button>
44
+ </template>
45
+ </template>
46
+ </template>
47
+ </zydx-topic-dry>
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <script>
53
+ import zydxTopicDry from "../../titleBox/src/zydxTopicDry"
54
+ import buttonName from "./button_name"
55
+ export default {
56
+ name: "zydx-head-level",
57
+ mixins: [buttonName],
58
+ props: {
59
+ actionId: {
60
+ type: String,
61
+ default: "action_checktime"
62
+ },
63
+ // 选中的节点
64
+ selectItem: {
65
+ type: Object,
66
+ default () {
67
+ return {}
68
+ }
69
+ },
70
+ // 班级还是个人
71
+ tabType: {
72
+ type: Number,
73
+ default: 0
74
+ },
75
+ // 选中的按钮标识
76
+ selectBtnIndex: {
77
+ type: String,
78
+ default: ''
79
+ },
80
+ // 是否显示操作按钮
81
+ isShowBtn: {
82
+ type: Boolean,
83
+ default: false
84
+ },
85
+ // 目录树集合
86
+ catalogList: {
87
+ type: Array,
88
+ default: function () {
89
+ return []
90
+ }
91
+ },
92
+ // 0动作或者1资源或者2学生端
93
+ headerType: {
94
+ type: Number,
95
+ default: 0
96
+ }
97
+ },
98
+ data() {
99
+ return {
100
+ nodeList: []
101
+ }
102
+ },
103
+ computed: {
104
+ getSelectBtnIndex () {
105
+ if (this.selectBtnIndex === '') {
106
+ let buttonIndex = '';
107
+ if (this.selectItem.level == 0 && this.tabType === 0) {
108
+ buttonIndex = 'demand';
109
+ } else {
110
+ buttonIndex = 'btnIndex1';
111
+ }
112
+ this.clickRightBtn(this.selectItem, buttonIndex);
113
+ return buttonIndex;
114
+ } else {
115
+ return this.selectBtnIndex;
116
+ }
117
+ }
118
+ },
119
+ mounted: function () {
120
+ this.selectNode(this.selectItem)
121
+ },
122
+ watch: {
123
+ actionId: {
124
+ deep: true,
125
+ handler: function (val) {
126
+ this.selectNode(this.selectItem)
127
+ }
128
+ },
129
+ selectItem: {
130
+ deep: true,
131
+ handler: function (val) {
132
+ this.selectNode(this.selectItem)
133
+ }
134
+ }
135
+ },
136
+ methods: {
137
+ // 选择节点
138
+ selectNode: function (node) {
139
+ this.nodeList = []
140
+ this.recursionNode(node.catalogId)
141
+ this.nodeList = this.nodeList.reverse()
142
+ },
143
+ // 递归节点
144
+ recursionNode: function (catalogId) {
145
+ let node = this.getNode(catalogId)
146
+ if (node) {
147
+ this.nodeList.push(node)
148
+ if (node.pcatalogId && node.pcatalogId !== -1) {
149
+ this.recursionNode(node.pcatalogId)
150
+ }
151
+ }
152
+ },
153
+ // 获取节点
154
+ getNode: function (catalogId) {
155
+ let node = null
156
+ this.catalogList.forEach(item => {
157
+ if (item.catalogId === catalogId) {
158
+ node = item
159
+ }
160
+ })
161
+ return node
162
+ },
163
+ clickRightBtn (selectItem, selectBtnIndex) {
164
+ this.$emit('clickRightBtn', {selectItem, selectBtnIndex, 'nodeList': this.nodeList})
165
+ }
166
+ },
167
+ components: {zydxTopicDry}
168
+ }
169
+ </script>
170
+
171
+ <style scoped>
172
+ .borderBottom1cccccc {
173
+ border-bottom: 1px #cccccc solid !important;
174
+ }
175
+ .z-button {
176
+ margin: 1px;
177
+ width: auto;
178
+ min-width: 60px;
179
+ max-width: 60px;
180
+ text-overflow: ellipsis;
181
+ white-space: nowrap;
182
+ overflow: hidden;
183
+ height: 20px;
184
+ background-color: #FFFFFF;
185
+ color: #000000;
186
+ border: #000000 1px solid;
187
+ line-height: 18px;
188
+ border-radius: 3px;
189
+ font-size: 12px !important;
190
+ letter-spacing: 0px !important;
191
+ text-align: center;
192
+ cursor: pointer;
193
+ padding: 0 5px;
194
+ font-weight: normal;
195
+ box-sizing: border-box;
196
+ }
197
+ .active{
198
+ color: rgba(0, 204, 126, 1) !important;
199
+ }
200
+ </style>