|
@@ -19,6 +19,7 @@
|
|
|
<el-radio label="right">右对齐</el-radio>
|
|
<el-radio label="right">右对齐</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="remark-box" @click="showRemark(index)"><SvgIcon icon-class="edit-line" />添加备注</div>
|
|
|
<div v-for="(items, indexs) in item.sentenceStr" :key="indexs + 'words'" class="sentence-box">
|
|
<div v-for="(items, indexs) in item.sentenceStr" :key="indexs + 'words'" class="sentence-box">
|
|
|
<div class="sentence">
|
|
<div class="sentence">
|
|
|
<b>{{ indexs + 1 }}.</b>
|
|
<b>{{ indexs + 1 }}.</b>
|
|
@@ -66,6 +67,88 @@
|
|
|
>
|
|
>
|
|
|
<CheckStyle :data="data" @saveStyle="saveStyle" />
|
|
<CheckStyle :data="data" @saveStyle="saveStyle" />
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog title="标注" :visible.sync="remarkVisible" width="50%" :close-on-click-modal="false" append-to-body>
|
|
|
|
|
+ <div v-if="remark" class="remark">
|
|
|
|
|
+ <div class="adult-book-input-item">
|
|
|
|
|
+ <span class="adult-book-lable">中文:</span>
|
|
|
|
|
+ <!-- <el-input
|
|
|
|
|
+ v-model="remark.chs"
|
|
|
|
|
+ class="adult-book-input"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
|
|
+ placeholder="请输入中文"
|
|
|
|
|
+ maxlength="200"
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ @blur="onBlur(remark, 'chs')"
|
|
|
|
|
+ /> -->
|
|
|
|
|
+ <RichText
|
|
|
|
|
+ ref="richText"
|
|
|
|
|
+ v-model="remark.chs"
|
|
|
|
|
+ toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
|
|
|
|
|
+ :wordlimit-num="200"
|
|
|
|
|
+ :font-size="data?.unified_attrib?.font_size"
|
|
|
|
|
+ :font-family="data?.unified_attrib?.font"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="adult-book-input-item">
|
|
|
|
|
+ <span class="adult-book-lable">英文:</span>
|
|
|
|
|
+ <!-- <el-input
|
|
|
|
|
+ class="adult-book-input"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
|
|
+ placeholder="请输入英文"
|
|
|
|
|
+ v-model="remark.en"
|
|
|
|
|
+ @blur="onBlur(remark, 'en')"
|
|
|
|
|
+ maxlength="200"
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ ></el-input> -->
|
|
|
|
|
+ <RichText
|
|
|
|
|
+ ref="richText"
|
|
|
|
|
+ v-model="remark.en"
|
|
|
|
|
+ toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
|
|
|
|
|
+ :wordlimit-num="200"
|
|
|
|
|
+ :font-size="data?.unified_attrib?.font_size"
|
|
|
|
|
+ :font-family="data?.unified_attrib?.font"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="remark.img_list && remark.img_list.length == 0" class="adult-book-input-item">
|
|
|
|
|
+ <el-upload action="no" accept="image/*" :show-file-list="false" :http-request="changeImage">
|
|
|
|
|
+ <el-button>上传图片</el-button>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <ul v-if="remark.img_list && remark.img_list.length > 0" class="uploadArt_list">
|
|
|
|
|
+ <li v-for="(artItem, artIndex) in remark.img_list" :key="'articleImgList' + artIndex">
|
|
|
|
|
+ <img :src="artItem.url" style="width: 26px; margin-right: 5px" />
|
|
|
|
|
+ <span class="art_name">{{ artItem.name }}</span>
|
|
|
|
|
+ <SvgIcon icon-class="delete-black" size="14" @click="delImage(artIndex)" />
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <div class="adult-book-input-item">
|
|
|
|
|
+ <span class="adult-book-lable">图片宽度:</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="remark.widthNumber"
|
|
|
|
|
+ class="adult-book-input"
|
|
|
|
|
+ placeholder="请输入宽度值"
|
|
|
|
|
+ maxlength="200"
|
|
|
|
|
+ style="width: 150px"
|
|
|
|
|
+ @blur="onBlur(remark, 'widthNumber')"
|
|
|
|
|
+ />
|
|
|
|
|
+ <span class="adult-book-lable">图片高度:</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="remark.heightNumber"
|
|
|
|
|
+ class="adult-book-input"
|
|
|
|
|
+ placeholder="请输入高度值"
|
|
|
|
|
+ maxlength="200"
|
|
|
|
|
+ style="width: 150px"
|
|
|
|
|
+ @blur="onBlur(remark, 'heightNumber')"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="remarkVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="saveRemark">保 存</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -73,11 +156,15 @@
|
|
|
import CheckWord from './CheckWord.vue';
|
|
import CheckWord from './CheckWord.vue';
|
|
|
import CheckPinyin from './CheckPinyin.vue';
|
|
import CheckPinyin from './CheckPinyin.vue';
|
|
|
import CheckStyle from './CheckStyle.vue';
|
|
import CheckStyle from './CheckStyle.vue';
|
|
|
|
|
+import RichText from '@/components/RichText.vue';
|
|
|
|
|
+import { fileUpload } from '@/api/app';
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
CheckWord,
|
|
CheckWord,
|
|
|
CheckPinyin,
|
|
CheckPinyin,
|
|
|
CheckStyle,
|
|
CheckStyle,
|
|
|
|
|
+ RichText,
|
|
|
},
|
|
},
|
|
|
props: ['data'],
|
|
props: ['data'],
|
|
|
data() {
|
|
data() {
|
|
@@ -86,6 +173,8 @@ export default {
|
|
|
showWordFlag: false,
|
|
showWordFlag: false,
|
|
|
showPinyinFlag: false,
|
|
showPinyinFlag: false,
|
|
|
showStyleFlag: false,
|
|
showStyleFlag: false,
|
|
|
|
|
+ remarkVisible: false,
|
|
|
|
|
+ remark: null,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -120,6 +209,34 @@ export default {
|
|
|
saveStyle(paraIndex, sentenceIndex, wordIndex, style) {
|
|
saveStyle(paraIndex, sentenceIndex, wordIndex, style) {
|
|
|
this.$emit('saveStyle', paraIndex, sentenceIndex, wordIndex, style);
|
|
this.$emit('saveStyle', paraIndex, sentenceIndex, wordIndex, style);
|
|
|
},
|
|
},
|
|
|
|
|
+ changeImage(file) {
|
|
|
|
|
+ fileUpload('Mid', file, { isGlobalprogress: true }).then(({ file_info_list }) => {
|
|
|
|
|
+ if (file_info_list.length > 0) {
|
|
|
|
|
+ const { file_id, file_url_open, file_name } = file_info_list[0];
|
|
|
|
|
+ this.remark.img_list.push({
|
|
|
|
|
+ name: file_name,
|
|
|
|
|
+ url: file_url_open,
|
|
|
|
|
+ id: file_id,
|
|
|
|
|
+ imgNumber: 0,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ delImage(index) {
|
|
|
|
|
+ this.remark.img_list.splice(index, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+ showRemark(index) {
|
|
|
|
|
+ this.remark = this.data.detail[index].remark;
|
|
|
|
|
+ this.paraIndex = index;
|
|
|
|
|
+ this.remarkVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ saveRemark() {
|
|
|
|
|
+ this.data.detail[this.paraIndex].remark = JSON.parse(JSON.stringify(this.remark));
|
|
|
|
|
+ this.remarkVisible = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ onBlur(item, field) {
|
|
|
|
|
+ item[field] = item[field] ? item[field].trim() : '';
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -243,4 +360,22 @@ export default {
|
|
|
text-align: left;
|
|
text-align: left;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.remark-box {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ width: fit-content;
|
|
|
|
|
+ height: 24px;
|
|
|
|
|
+ padding: 2px 12px;
|
|
|
|
|
+ margin: 16px 0 0;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ line-height: 20px; /* 166.667% */
|
|
|
|
|
+ color: #165dff;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ border: 1px solid #165dff;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|