|
@@ -122,6 +122,38 @@ function validateTimeStr(rule, value, callback){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * 根据阿拉伯数字返回对应的中文数字,支持到千
|
|
|
|
+ * @param {Number} num 阿拉伯数字
|
|
|
|
+ */
|
|
|
|
+function getChineseNum4(num) {
|
|
|
|
+ let result = ''
|
|
|
|
+ let unit = ['', '十', '百', '千']
|
|
|
|
+ let unitIndex = 0
|
|
|
|
+ while (num > 0) {
|
|
|
|
+ let temp = num % 10
|
|
|
|
+ if (temp > 0) {
|
|
|
|
+ result = getChineseNum1(temp) + unit[unitIndex] + result
|
|
|
|
+ }
|
|
|
|
+ num = Math.floor(num / 10)
|
|
|
|
+ unitIndex++
|
|
|
|
+ }
|
|
|
|
+ return result
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 根据阿拉伯数字返回对应的中文数字,支持到一
|
|
|
|
+ * @param {Number} num 阿拉伯数字
|
|
|
|
+ */
|
|
|
|
+function getChineseNum1(num) {
|
|
|
|
+ let result = ''
|
|
|
|
+ let unit = ['一', '二', '三', '四', '五', '六', '七', '八', '九']
|
|
|
|
+ if (num > 0 && num < 10) {
|
|
|
|
+ result = unit[num - 1]
|
|
|
|
+ }
|
|
|
|
+ return result
|
|
|
|
+}
|
|
|
|
+
|
|
function initReferenceData(){
|
|
function initReferenceData(){
|
|
return {
|
|
return {
|
|
id: 1,
|
|
id: 1,
|
|
@@ -426,7 +458,7 @@ const edit = new Vue({
|
|
},
|
|
},
|
|
//
|
|
//
|
|
getInfoNamePlaceHolder(index){
|
|
getInfoNamePlaceHolder(index){
|
|
- const text = ['中文名', '别名', '英文名']
|
|
|
|
|
|
+ const text = ['中文名', '别名', '英文名', '尺寸']
|
|
return text[index]
|
|
return text[index]
|
|
},
|
|
},
|
|
// 新增信息栏
|
|
// 新增信息栏
|
|
@@ -438,8 +470,10 @@ const edit = new Vue({
|
|
this.formData.infoList.splice(index, 1)
|
|
this.formData.infoList.splice(index, 1)
|
|
},
|
|
},
|
|
// 正文目录数据
|
|
// 正文目录数据
|
|
- genereateTextInfo(type) {
|
|
|
|
|
|
+ genereateTextInfo(type, index) {
|
|
let placeholderList = ['一级标题', '二级标题', '内容']
|
|
let placeholderList = ['一级标题', '二级标题', '内容']
|
|
|
|
+ let prefixList = [getChineseNum4(index), ]
|
|
|
|
+ let dictionaryContentPrefix = getChineseNum4(index)
|
|
return {
|
|
return {
|
|
id: '',
|
|
id: '',
|
|
entryId: '',
|
|
entryId: '',
|
|
@@ -453,7 +487,7 @@ const edit = new Vue({
|
|
},
|
|
},
|
|
// 添加正文目录
|
|
// 添加正文目录
|
|
handleAddTextInfo(index, type) {
|
|
handleAddTextInfo(index, type) {
|
|
- this.formData.textInfoList.splice(index + 1, 0, this.genereateTextInfo(type))
|
|
|
|
|
|
+ this.formData.textInfoList.splice(index + 1, 0, this.genereateTextInfo(type, index + 1))
|
|
},
|
|
},
|
|
// 删除正文目录
|
|
// 删除正文目录
|
|
handleRemoveTextInfo(index, type) {
|
|
handleRemoveTextInfo(index, type) {
|