123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <div class="TableView" v-if="curQue">
- <div class="table">
- <table>
- <template v-if="curQue.headerList.length > 0">
- <tr>
- <th
- v-for="(item, headIndex) in curQue.headerList"
- :key="'header' + headIndex"
- :style="{ width: curQue.colWidthList[headIndex].con + '%' }"
- >
- {{ item.con }}
- </th>
- </tr>
- </template>
- <tr v-for="(row, rowIndex) in curQue.option" :key="'row' + rowIndex">
- <td
- v-for="(col, colIndex) in row"
- :key="'col' + colIndex"
- :style="{ width: curQue.colWidthList[colIndex].con + '%' }"
- >
- <template v-if="!col.isNumll">
- {{ col.con }}
- </template>
- <template v-else>
- <input type="text" v-model="col.con" />
- </template>
- </td>
- </tr>
- </table>
- </div>
- <div class="hint">
- <p>{{ curQue.hintTitle }}</p>
- <div>
- <div v-for="(item, i) in curQue.hintOtion" :key="'hint' + i">
- <p>{{ item.pinyin }}</p>
- <p>{{ item.con }}</p>
- </div>
- </div>
- </div>
- <div class="record">
- <Soundrecord @handleWav="handleWav" type="pro-plus" class="luyin-box" />
- </div>
- </div>
- </template>
- <script>
- //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》from ‘《组件路径》';
- import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- Soundrecord,
- },
- props: ["curQue"],
- data() {
- //这里存放数据
- return {};
- },
- //计算属性 类似于data概念
- computed: {},
- //监控data中数据变化
- watch: {},
- //方法集合
- methods: {
- handleWav(data) {},
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- this.curQue.option.forEach((item) => {
- item.forEach((it) => {
- if (it.con == "") {
- it.isNumll = true;
- }
- });
- });
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {},
- //生命周期-创建之前
- beforeCreated() {},
- //生命周期-挂载之前
- beforeMount() {},
- //生命周期-更新之前
- beforUpdate() {},
- //生命周期-更新之后
- updated() {},
- //生命周期-销毁之前
- beforeDestory() {},
- //生命周期-销毁完成
- destoryed() {},
- //如果页面有keep-alive缓存功能,这个函数会触发
- activated() {},
- };
- </script>
- <style lang="scss" scoped>
- /* @import url(); 引入css类 */
- .TableView {
- .hint {
- p {
- font-family: "robot";
- font-style: normal;
- font-weight: normal;
- font-size: 16px;
- line-height: 150%;
- color: #000000;
- }
- > div {
- display: flex;
- > div {
- min-width: 82px;
- min-height: 70px;
- padding: 8px 16px;
- background: #f7f7f7;
- border-radius: 8px;
- margin-right: 8px;
- p {
- margin: 0;
- }
- > :nth-child(1) {
- font-family: "GB-PINYINOK-B";
- font-style: normal;
- font-weight: normal;
- font-size: 16px;
- line-height: 150%;
- text-align: center;
- color: #000000;
- }
- > :nth-child(2) {
- font-family: "FZJCGFKTK";
- font-style: normal;
- font-weight: normal;
- font-size: 20px;
- line-height: 150%;
- text-align: center;
- color: #000000;
- }
- }
- }
- }
- .record {
- margin-top: 11px;
- width: 292px;
- height: 40px;
- padding: 0 12px;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 1px solid rgba(0, 0, 0, 0.1);
- box-sizing: border-box;
- border-radius: 8px;
- }
- .table {
- width: 100%;
- table {
- width: 100%;
- border-collapse: collapse; //取消单元格之间的间距
- tr {
- width: 100%;
- th {
- background: rgba(236, 157, 99, 0.1);
- border: 1px solid #e2cfc1;
- height: 40px;
- }
- td {
- background: #ffffff;
- border: 1px solid #e2cfc1;
- height: 64px;
- text-align: center;
- input {
- width: 80%;
- outline: none;
- border: none;
- border-bottom: 1px solid black;
- }
- }
- }
- }
- }
- }
- </style>
|