update 属性类型新增年份选择

This commit is contained in:
赵霄
2023-09-14 14:33:04 +08:00
parent bdb9e0d18c
commit a1e4a12ff6
7 changed files with 78 additions and 6 deletions
+3
View File
@@ -32,6 +32,8 @@ const addDomesticStandard = (params) => postAction('/laws/standard/domestic/comm
const editDomesticStandard = (params) => postAction('/laws/standard/domestic/commonEdit', params)
// 国内标准-配置标准-过滤没有选中体系的数据
const getDomesticStandardNoSystem = (params) => getAction('/laws/standard/common/getStandardRightBox', params)
// 国内标准-获取详情信息
const getDomesticStandardDetail = (params) => getAction('/laws/standard/domestic/getByIdAndModule', params)
// 海外标准-获取查询条件
const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
@@ -60,6 +62,7 @@ export {
addDomesticStandard,
editDomesticStandard,
getDomesticStandardNoSystem,
getDomesticStandardDetail,
// 海外标准
getOverseasStandardSearchForm,
+2
View File
@@ -600,6 +600,8 @@
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #1D2129;
flex: 1;
width: 0;
}
}
+23 -1
View File
@@ -222,6 +222,22 @@
</a-form-model-item>
</div>
</a-col>
<!--14 年份选择-->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
<div class="box-title-text" :title="item.dbFieldTxt">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text">{{ item.dbFieldTxt }}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-date show-type="year"
v-model="formInline[item.dbFieldName]"
:default-value="defaultValue[item.dbFieldName]"
date-format="YYYY"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"/>
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
@@ -326,7 +342,8 @@ export default {
},
methods: {
add () {
this.formInline = Object.assign({}, this.defaultValue)
this.$set(this.formInline, 'year_number', '2023')
this.$forceUpdate()
this.type = 'add'
this.getForm()
},
@@ -483,4 +500,9 @@ export default {
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .ant-form-item-children {
width: 100%;
display: inline-block;
}
</style>
+10 -1
View File
@@ -10,6 +10,7 @@
:value="momVal"
:showTime="true"
:format="dateFormat"
style="width: 100%"
v-bind="$attrs"
v-on="childListeners"
:getCalendarContainer="getCalendarContainer">
@@ -24,6 +25,7 @@
:value="momVal"
:showTime="false"
:format="dateFormat"
style="width: 100%"
v-bind="$attrs"
v-on="childListeners"
:getCalendarContainer="getCalendarContainer">
@@ -35,6 +37,7 @@
:value="momVal"
:disabled="disabled || readOnly"
:format="dateFormat"
style="width: 100%"
v-bind="$attrs"
v-on="childListeners"
@change="handleMonthChange">
@@ -51,6 +54,7 @@
v-bind="$attrs"
v-on="childListeners"
:getCalendarContainer="getCalendarContainer"
style="width: 100%"
@openChange="openChangeOne"
@panelChange="panelChangeOne">
</a-date-picker>
@@ -116,6 +120,7 @@ export default {
},
watch: {
value (val) {
console.log(val)
const fm = this.dateFormat
moment.prototype.toJSON = function () {
return moment(this).format(fm)
@@ -123,7 +128,11 @@ export default {
if (!val) {
this.momVal = null
} else {
this.momVal = moment(val, this.dateFormat)
if (this.showType === 'year') {
this.year = val
} else {
this.momVal = moment(val, this.dateFormat)
}
}
}
},
+2 -1
View File
@@ -20,7 +20,8 @@ export const FieldType = {
OPTION_SINGLE: { text: '下拉单选', value: '10' },
OPTION_MORE: { text: '下拉多选', value: '11' },
TREE: { text: '树形结构', value: '12' },
TEXT_LINK: { text: '输入框(链接)', value: '13' }
TEXT_LINK: { text: '输入框(链接)', value: '13' },
YEAR_PICKER: { text: '年份选择', value: '14' }
}
export const TagsTypeEnums = new EsEnums({
@@ -73,12 +73,13 @@
<script>
import '@assets/less/common.less'
import { TagsTypeEnums } from '../../../enums/commonEnums'
import { getDomesticStandardFormModal, shareDomesticStandard } from '../../../api/standardRegulationLibraryApi'
import { getDomesticStandardFormModal, shareDomesticStandard, getDomesticStandardDetail } from '../../../api/standardRegulationLibraryApi'
import UploadRecordModal from './modules/UploadRecordModal.vue'
import SubmitQuestionModal from './modules/SubmitQuestionModal.vue'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import StandardResolutionSheetModal from './modules/StandardResolutionSheetModal.vue'
// 国内标准权限
const DomesticStandardPermission = {
updateRecord: 'domesticStandard:updateRecord', // 更新记录
submitQuestion: 'domesticStandard:submitQuestion', // 提交问题
@@ -88,6 +89,12 @@ const DomesticStandardPermission = {
unwatermarkedDownload: 'domesticStandard:unwatermarkedDownload' // 无水印下载
}
// 国内标准接口
const DomesticApi = {
getFormFunc: getDomesticStandardFormModal, // 获取字段
getDetailData: getDomesticStandardDetail // 获取详情数据
}
export default {
name: 'StandardDetailPage',
components: { UploadRecordModal, SubmitQuestionModal, UserSelectModal, StandardResolutionSheetModal },
@@ -112,9 +119,11 @@ export default {
}
},
computed: {
// 页面标题
pageTitle () {
return TagsTypeEnums.nameOfIndex(this.$route.query.type)
},
// 按钮权限
btnPermission () {
let permission = {}
switch (this.$route.query.type) {
@@ -126,17 +135,30 @@ export default {
break
}
return permission
},
// 操作接口
operateApiFunc () {
let func = {}
switch (this.$route.query.type) {
case TagsTypeEnums.DOMESTIC_LIST.value + '':
func = DomesticApi
break
default:
break
}
return func
}
},
created () {
this.initForm()
this.initDetailData()
},
methods: {
/**
* 获取页面字段
*/
initForm () {
getDomesticStandardFormModal().then(res => {
this.operateApiFunc.getFormFunc().then(res => {
if (res.success) {
const data = res.result || {}
this.partList = Object.keys(data)
@@ -146,6 +168,19 @@ export default {
}
})
},
// 获取数据
initDetailData () {
this.loading = true
this.operateApiFunc.getDetailData({ id: this.$route.query.id }).then(res => {
if (res.success) {
this.detailData = Object.assign({}, res.result || {})
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 更新记录
*/
@@ -56,7 +56,7 @@ export default {
standard_number: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear()
year_number: new Date().getFullYear() + ''
},
isEdit: null // 是否编辑
}