jinlin
2024-01-31 9025b9cf7ec8610003d445a31d93e35e7bd73c2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<template>
  <div id="wai">
    <div class="divLeft">
      <h2 >{{helpDataSys.systemName}}用户操作说明</h2>
      <div v-for="item in helpDataSys.data" :key="item.id">
        <h3 @click="toggleCollapse(helpDataSys.data,item.id)" style="cursor: pointer;font-size: 20px">
          <span :class="{ 'collapsed': item.isCollapsed }">▷</span>
          {{item.user}}
        </h3>
        <ol :class="{'isCollapsed':!item.isCollapsed}" v-show="item.isCollapsed" style="font-weight: initial;line-height: initial;">
          <li v-for="item1 in item.modules" :key="item1.id" style="margin-top: 10px; margin-bottom: 5px">
            <span @click="toggleCollapse(item.modules,item1.id)">{{item1.module}}</span>
            <ol :class="{'isCollapsed':!item1.isCollapsed}" v-show="item1.isCollapsed" class="funcList" style="transition: .5s">
              <li v-for="item2 in item1.functions" :key="item2.id" class="func" @click="clickFunc(item.user, item1.module, item2.function, item2.docFile, item2.videoFile)">
                {{item2.function}}</li>
            </ol>
          </li>
        </ol>
      </div>
    </div>
 
    <div class="divRight">
      <div style="margin: 10px; display: flex;">
        <div style="flex: 1;">
          <el-radio-group v-model="dispType" @change="dispTypeChange">
            <el-radio class="radio" label="1">操作说明</el-radio>
            <el-radio class="radio" label="2">录屏演示</el-radio>
          </el-radio-group>
        </div>
        <div style="flex: 1; text-align: center" id="helpTitle">
          <h3 ></h3>
        </div>
        <div id="userManual"  style="flex: 1; text-align: right;">
          <el-dropdown trigger="hover">
            <span class="el-dropdown-link">
              下载用户手册<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu @click.native.stop>
              <el-dropdown-item v-for="item in helpDataSys.userManual" :key="item.id">
                <a :href="item.file" style="color:#000">{{ item.name }}</a>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </div>
      <div style="height: 100%;">
        <div id="divDoc" style="height: 100%;">
          <iframe id="iframe" src="" width="100%" height="95%"></iframe>
        </div>
        <div id="divVideo">
          <video id="video" src="" controls type="video/mp4">
          </video>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
  import Cookies from "js-cookie";
 
  export default {
    name: 'UserHelp',
    data(){
      return{
        isCollapsed:false,
        system: '',  // djxl, smj
        helpDataSys: '',
        dispType: '1',
        user: '',
        modulename: '',
        funcname: '',
        docfile: '',
        videofile: '',
      }
    },
    mounted() {
      this.system = Cookies.get('system');
      // userhelp_jsondata在/help/helpdata.js中定义,/help/helpdata.js在index.html中引入。
      if (this.system) {
        for (let i = 0; i < userhelp_jsondata.length; i++) {
          if (this.system == userhelp_jsondata[i].system) {
            this.helpDataSys = userhelp_jsondata[i];
          }
        }
      }else{
        this.helpDataSys = userhelp_jsondata[0]
      }
    },
    methods: {
      toggleCollapse(Dates,id) {
        console.log(id)
        for (const item of Dates) {
          console.log(item.id)
          if (item.id === id) {
            item.isCollapsed = !item.isCollapsed; // 切换展开(收缩)状态
            break;
          }
        }
      },
      switchDispType() {
        var myIframe = document.getElementById("iframe");
        var myVideo = document.getElementById("video");
        if (this.dispType=="1") {
          document.getElementById("divVideo").style.display="none";
          document.getElementById("divDoc").style.display="";
          myIframe.src = this.docfile;
          if (!myVideo.paused) {
            myVideo.pause();
          }
        } else {
          document.getElementById("divDoc").style.display="none";
          document.getElementById("divVideo").style.display="";
          if (myVideo.paused) {
            myVideo.src = this.videofile;
            myVideo.volume=0;
            myVideo.play();
          } else {
            myVideo.pause();
            myVideo.src = this.videofile;
            myVideo.volume=0;
            myVideo.play();
          }
        }
      },
      clickFunc(user, modulename, funcname, docfile, videofile) {
        this.user = user;
        this.modulename = modulename;
        this.funcname = funcname;
        this.docfile = docfile;
        this.videofile = videofile;
        var myTitle = document.getElementById("helpTitle");
        myTitle.innerHTML = user+"--"+modulename+"--"+funcname;
        this.switchDispType();
      },
      dispTypeChange() {
        if (this.funcname) {
          this.switchDispType();
        }
      }
    }
  }
</script>
 
<style>
#video {
  margin: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#wai{ width:100%; height: 100vh; padding:10px; overflow:hidden;background: #062944;color:#FFF}
.divLeft{ float:left; width: 300px; height: 100%; overflow-y:scroll; }
.divRight{ margin-left: 310px; height: 100%;}
.divRight .radio{
  color:#fff;
}
.divLeft>div>h3:hover{
  background-color:rgba(2, 120, 231, 1);
  transition: .5s;
}
.divLeft ol>li>span{
  font-weight: bold;
  list-style-position: inside;
  cursor: pointer;
  display: inline-block;
  font-size: 18px;
  width: 100%;
}
.divLeft ol>li>span:hover{
  /*border: 1px solid rgba(2, 120, 231, 1);*/
  background-color:rgba(2, 120, 231, 1);
  transition: .5s;
}
.funcList{ margin-left: 10px;padding-left:10px;font-size: 16px}
.funcList li {
  padding: 5px;
  color:#fff;
  list-style-position: inside;
}
.funcList li:hover{
  background-color:rgba(2, 120, 231, .6);
  transition: .5s;
}
.func{ text-decoration: none; color: #0000ff; cursor:pointer; }
/* 正常情况下滑块的样式 */
#wai ::-webkit-scrollbar-thumb {
  background-color: rgba(23, 179, 163, 0.2);
  border-radius: 2px;
  -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .3);
}
#wai ::-webkit-scrollbar-corner{
  background-color: rgba(23, 179, 163, 0.3);
}
/* 鼠标悬浮在该类指向的控件上时滑块的样式 */
#wai :hover::-webkit-scrollbar-thumb {
  background-color: rgba(23, 179, 163, 0.5);
  border-radius: 2px;
  -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
}
 
/* 鼠标悬浮在滑块上时滑块的样式 */
#wai ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(23, 179, 163, 0.5);
  -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1);
}
 
/* 正常时候的主干部分 */
#wai ::-webkit-scrollbar-track {
  border-radius: 2px;
  /*-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);*/
}
 
/* 鼠标悬浮在滚动条上的主干部分 */
#wai::-webkit-scrollbar-track:hover {
  /*-webkit-box-shadow: inset 0 0 6px rgba(123, 224, 244, 0.1);*/
  background-color: rgba(23, 179, 163, 0.5);
}
#wai .el-dropdown{
  color:#fff;
}
.collapsed {
  transform: rotate(0.5turn);
}
.isCollapsed{
  display: block;
  transition: .5s;
}
</style>