|
|
@@ -7,11 +7,7 @@
|
|
|
>
|
|
|
<div v-if="dialogLoading">
|
|
|
<van-sticky>
|
|
|
- <van-nav-bar
|
|
|
- title="公告"
|
|
|
- left-arrow
|
|
|
- @click-left="onClose"
|
|
|
- >
|
|
|
+ <van-nav-bar title="公告" left-arrow @click-left="onClose">
|
|
|
<template #left>
|
|
|
<van-icon name="cross" class="ibps-nav-bar__close-icon" />
|
|
|
</template>
|
|
|
@@ -30,7 +26,7 @@
|
|
|
autocomplete="off"
|
|
|
:rules="[{ required: true, message: '必填' }]"
|
|
|
/>
|
|
|
- <ibps-radio
|
|
|
+ <!-- <ibps-radio
|
|
|
v-model="form.publicItem"
|
|
|
:options="publishOptions"
|
|
|
:clearable="false"
|
|
|
@@ -42,8 +38,8 @@
|
|
|
category-key="NOTICE_TYPE"
|
|
|
label="类型"
|
|
|
clearable
|
|
|
- />
|
|
|
- <ibps-user-selector
|
|
|
+ /> -->
|
|
|
+ <!-- <ibps-user-selector
|
|
|
v-model="userSelect"
|
|
|
label="发布人"
|
|
|
type="user"
|
|
|
@@ -59,16 +55,16 @@
|
|
|
inactive-value="N"
|
|
|
/>
|
|
|
</template>
|
|
|
- </van-field>
|
|
|
+ </van-field> -->
|
|
|
|
|
|
- <ibps-user-selector
|
|
|
- v-show="form.public0==='N'"
|
|
|
+ <!-- <ibps-user-selector
|
|
|
+ v-show="form.public0 === 'N'"
|
|
|
v-model="orgSelect"
|
|
|
label="发布范围"
|
|
|
type="org"
|
|
|
store="array"
|
|
|
clearable
|
|
|
- />
|
|
|
+ /> -->
|
|
|
<van-field
|
|
|
v-model="form.author"
|
|
|
label="作者"
|
|
|
@@ -78,7 +74,7 @@
|
|
|
autocomplete="off"
|
|
|
name="text"
|
|
|
/>
|
|
|
- <van-field
|
|
|
+ <!-- <van-field
|
|
|
v-model="form.key"
|
|
|
label="关键字"
|
|
|
placeholder="请输入"
|
|
|
@@ -86,7 +82,7 @@
|
|
|
clearable
|
|
|
name="text"
|
|
|
autocomplete="off"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
<ibps-date-picker
|
|
|
v-model="form.publicDate"
|
|
|
label="发布时间"
|
|
|
@@ -108,29 +104,30 @@
|
|
|
placeholder="请上传附件"
|
|
|
clearable
|
|
|
/>
|
|
|
- <ibps-editor
|
|
|
- v-model="form.content"
|
|
|
- label="内容"
|
|
|
- />
|
|
|
- <ibps-toolbar
|
|
|
- :actions="actions"
|
|
|
- />
|
|
|
+ <ibps-editor v-model="form.content" label="内容" />
|
|
|
+ <ibps-toolbar :actions="actions" />
|
|
|
</van-form>
|
|
|
</div>
|
|
|
|
|
|
<!--明细-->
|
|
|
<div v-else class="ibps-notice-detail">
|
|
|
<van-row>
|
|
|
- <van-col span="24" class="notice-title ibps-size-l_xx">{{ form.title }}</van-col>
|
|
|
+ <van-col span="24" class="notice-title ibps-size-l_xx">{{
|
|
|
+ form.title
|
|
|
+ }}</van-col>
|
|
|
<van-col span="24" class="notice-detailed">
|
|
|
<van-row gutter="5" type="flex" align="center">
|
|
|
<!-- <van-col class="notice-time-horizon">{{ form.publicDate|dateFormat('yyyy-MM-dd') }} <span v-if="$utils.isNotEmpty(form.loseDate)"> ~ </span>{{ form.loseDate|dateFormat('yyyy-MM-dd') }}</van-col>
|
|
|
<van-col class="notice-userName ibps-is-link">{{ form.userName }}</van-col> -->
|
|
|
<van-col span="15">
|
|
|
<span class="notice-time-horizon">
|
|
|
- {{ form.publicDate|dateFormat('yyyy-MM-dd') }} <span v-if="$utils.isNotEmpty(form.loseDate)"> ~ </span>{{ form.loseDate|dateFormat('yyyy-MM-dd') }}
|
|
|
+ {{ form.publicDate | dateFormat('yyyy-MM-dd') }}
|
|
|
+ <span v-if="$utils.isNotEmpty(form.loseDate)"> ~ </span
|
|
|
+ >{{ form.loseDate | dateFormat('yyyy-MM-dd') }}
|
|
|
</span>
|
|
|
- <span class="notice-userName ibps-is-link ibps-wingblank">{{ form.userName }}</span>
|
|
|
+ <span class="notice-userName ibps-is-link ibps-wingblank">{{
|
|
|
+ form.userName
|
|
|
+ }}</span>
|
|
|
</van-col>
|
|
|
|
|
|
<!-- <van-col
|
|
|
@@ -139,16 +136,19 @@
|
|
|
:style="{'color':form.publicItem==='important'?'#f56c6c':'#67c23a'}"
|
|
|
> {{ form.publicItem| optionsFilter(publishOptions) }}</van-col> -->
|
|
|
|
|
|
- <van-col
|
|
|
- span="9"
|
|
|
- class="notice-publicItem"
|
|
|
- > <van-tag
|
|
|
- size="medium"
|
|
|
- :color="form.publicItem | optionsFilter(publishOptions,'color')"
|
|
|
- :text-color="form.publicItem | optionsFilter(publishOptions,'textColor')"
|
|
|
- >
|
|
|
- {{ form.publicItem| optionsFilter(publishOptions) }}</van-tag></van-col>
|
|
|
-
|
|
|
+ <van-col span="9" class="notice-publicItem">
|
|
|
+ <van-tag
|
|
|
+ size="medium"
|
|
|
+ :color="
|
|
|
+ form.publicItem | optionsFilter(publishOptions, 'color')
|
|
|
+ "
|
|
|
+ :text-color="
|
|
|
+ form.publicItem | optionsFilter(publishOptions, 'textColor')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ form.publicItem | optionsFilter(publishOptions) }}
|
|
|
+ </van-tag>
|
|
|
+ </van-col>
|
|
|
</van-row>
|
|
|
</van-col>
|
|
|
<van-col span="24" class="notice-content">
|
|
|
@@ -157,6 +157,7 @@
|
|
|
label="内容"
|
|
|
:have-padding="false"
|
|
|
readonly
|
|
|
+ class="scrollRestrict"
|
|
|
/>
|
|
|
</van-col>
|
|
|
<van-col span="24" class="notice-fileAttach">
|
|
|
@@ -208,29 +209,63 @@ export default {
|
|
|
readonly: Boolean
|
|
|
},
|
|
|
data() {
|
|
|
+ const { first = '', second = '' } = this.$store.getters.level || {}
|
|
|
+ const { positions = [] } = this.$store.getters.userInfo || {}
|
|
|
+ const position = positions.length ? positions[0] : {}
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
dialogLoading: false,
|
|
|
defaultForm: {
|
|
|
+ author: '',
|
|
|
+ content: '',
|
|
|
+ createBy: '',
|
|
|
+ createOrgId: '',
|
|
|
+ createTime: '',
|
|
|
+ dataStatus: '',
|
|
|
+ dbtype: '',
|
|
|
+ depId: position.id,
|
|
|
+ depName: position.name,
|
|
|
+ fileAttach: '',
|
|
|
id: '',
|
|
|
- picture: '',
|
|
|
- status: '',
|
|
|
- publicItem: 'notices',
|
|
|
- typeId: '',
|
|
|
- type: '',
|
|
|
- title: '',
|
|
|
- userId: '',
|
|
|
- userName: '',
|
|
|
+ ip: '',
|
|
|
public0: 'Y',
|
|
|
- depId: '',
|
|
|
- depName: '',
|
|
|
- author: '',
|
|
|
+ includeChild: 'N',
|
|
|
key: '',
|
|
|
- publicDate: '',
|
|
|
loseDate: '',
|
|
|
- fileAttach: '',
|
|
|
- content: '',
|
|
|
- editorValue: ''
|
|
|
+ name: '',
|
|
|
+ picture: '',
|
|
|
+ pk: '',
|
|
|
+ publicDate: this.$common.getDateNow(19),
|
|
|
+ publicItem: 'notices',
|
|
|
+ status: '',
|
|
|
+ tenantId: '',
|
|
|
+ title: '',
|
|
|
+ // 改字段暂时无用,改存当前层级第一级ID
|
|
|
+ type: second || first,
|
|
|
+ typeId: '',
|
|
|
+ updateBy: '',
|
|
|
+ updateTime: '',
|
|
|
+ userId: this.$store.getters.userId,
|
|
|
+ userName: this.$store.getters.name
|
|
|
+ // id: '',
|
|
|
+ // picture: '',
|
|
|
+ // status: '',
|
|
|
+ // publicItem: 'notices',
|
|
|
+ // typeId: '',
|
|
|
+ // type: '',
|
|
|
+ // title: '',
|
|
|
+ // userId: '',
|
|
|
+ // userName: '',
|
|
|
+ // public0: 'Y',
|
|
|
+ // depId: '',
|
|
|
+ // depName: '',
|
|
|
+ // author: '',
|
|
|
+ // key: '',
|
|
|
+ // publicDate: '',
|
|
|
+ // loseDate: '',
|
|
|
+ // fileAttach: '',
|
|
|
+ // content: '',
|
|
|
+ // editorValue: ''
|
|
|
},
|
|
|
form: {},
|
|
|
userSelect: [],
|
|
|
@@ -238,15 +273,16 @@ export default {
|
|
|
publishOptions: publishOptions,
|
|
|
actions: [
|
|
|
{
|
|
|
- 'name': this.$t('common.button.ts'),
|
|
|
- 'type': 'default',
|
|
|
- 'callback': this.saveDraft
|
|
|
+ name: this.$t('common.button.ts'),
|
|
|
+ type: 'default',
|
|
|
+ callback: this.saveDraft
|
|
|
},
|
|
|
{
|
|
|
- 'name': this.$t('common.button.save'),
|
|
|
- 'type': 'primary',
|
|
|
- 'callback': this.saveData
|
|
|
- }]
|
|
|
+ name: this.$t('common.button.save'),
|
|
|
+ type: 'primary',
|
|
|
+ callback: this.saveData
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -287,30 +323,48 @@ export default {
|
|
|
if (this.$utils.isEmpty(this.id)) {
|
|
|
this.form.publicItem = 'notices'
|
|
|
this.form.publicDate = fecha.format(new Date(), 'yyyy-MM-dd')
|
|
|
- this.userSelect = [{ 'id': this.$store.getters.userId, 'name': this.$store.getters.userName }]
|
|
|
+ this.userSelect = [
|
|
|
+ { id: this.$store.getters.userId, name: this.$store.getters.userName }
|
|
|
+ ]
|
|
|
return
|
|
|
}
|
|
|
get({
|
|
|
newsId: this.id
|
|
|
- }).then(response => {
|
|
|
- const data = response.data
|
|
|
- if (this.$utils.isNotEmpty(data.publicDate)) {
|
|
|
- data.publicDate = fecha.format(fecha.parse(data.publicDate, 'yyyy-MM-dd'), 'yyyy-MM-dd')
|
|
|
- }
|
|
|
- if (this.$utils.isNotEmpty(data.loseDate)) {
|
|
|
- data.loseDate = fecha.format(fecha.parse(data.loseDate, 'yyyy-MM-dd'), 'yyyy-MM-dd')
|
|
|
- }
|
|
|
-
|
|
|
- this.form = data
|
|
|
- if (this.$utils.isNotEmpty(this.form.userId) && this.$utils.isNotEmpty(this.form.userName)) {
|
|
|
- this.userSelect = [{ 'id': this.form.userId, 'name': this.form.userName }]
|
|
|
- }
|
|
|
- if (this.$utils.isNotEmpty(this.form.depId) && this.$utils.isNotEmpty(this.form.depName)) {
|
|
|
- this.orgSelect = [{ 'id': this.form.depId, 'name': this.form.depName }]
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- console.error(error)
|
|
|
})
|
|
|
+ .then(response => {
|
|
|
+ const data = response.data
|
|
|
+ if (this.$utils.isNotEmpty(data.publicDate)) {
|
|
|
+ data.publicDate = fecha.format(
|
|
|
+ fecha.parse(data.publicDate, 'yyyy-MM-dd'),
|
|
|
+ 'yyyy-MM-dd'
|
|
|
+ )
|
|
|
+ }
|
|
|
+ if (this.$utils.isNotEmpty(data.loseDate)) {
|
|
|
+ data.loseDate = fecha.format(
|
|
|
+ fecha.parse(data.loseDate, 'yyyy-MM-dd'),
|
|
|
+ 'yyyy-MM-dd'
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form = data
|
|
|
+ if (
|
|
|
+ this.$utils.isNotEmpty(this.form.userId) &&
|
|
|
+ this.$utils.isNotEmpty(this.form.userName)
|
|
|
+ ) {
|
|
|
+ this.userSelect = [
|
|
|
+ { id: this.form.userId, name: this.form.userName }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.$utils.isNotEmpty(this.form.depId) &&
|
|
|
+ this.$utils.isNotEmpty(this.form.depName)
|
|
|
+ ) {
|
|
|
+ this.orgSelect = [{ id: this.form.depId, name: this.form.depName }]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error(error)
|
|
|
+ })
|
|
|
},
|
|
|
onBack() {
|
|
|
this.$router.push({ name: 'notice' })
|
|
|
@@ -337,68 +391,82 @@ export default {
|
|
|
if (this.$utils.isNotEmpty(data.loseDate)) {
|
|
|
data.loseDate += ' 00:00:00'
|
|
|
}
|
|
|
- save(data).then(response => {
|
|
|
- const message = this.form.status === 'drafts' ? `暂存公告成功!` : `保存公告成功!`
|
|
|
- this.$notify({
|
|
|
- type: 'success',
|
|
|
- message: message
|
|
|
+ save(data)
|
|
|
+ .then(response => {
|
|
|
+ const message =
|
|
|
+ this.form.status === 'drafts' ? `暂存公告成功!` : `保存公告成功!`
|
|
|
+ this.$notify({
|
|
|
+ type: 'success',
|
|
|
+ message: message
|
|
|
+ })
|
|
|
+ this.onClose()
|
|
|
+ this.$emit('callback', true)
|
|
|
+ // this.$router.push({ name: 'notice' })
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error(error)
|
|
|
})
|
|
|
- this.onClose()
|
|
|
- this.$emit('callback', true)
|
|
|
- // this.$router.push({ name: 'notice' })
|
|
|
- }).catch(error => {
|
|
|
- console.error(error)
|
|
|
- })
|
|
|
},
|
|
|
saveDraft() {
|
|
|
this.form.status = 'drafts'
|
|
|
this.onSave()
|
|
|
},
|
|
|
saveData() {
|
|
|
- this.$refs.form.validate().then(() => {
|
|
|
- this.form.status = 'publish'
|
|
|
- this.onSave()
|
|
|
- }).catch(() => {
|
|
|
- this.$notify({
|
|
|
- type: 'warning',
|
|
|
- message: this.$t('common.formError')
|
|
|
+ this.$refs.form
|
|
|
+ .validate()
|
|
|
+ .then(() => {
|
|
|
+ this.form.status = 'publish'
|
|
|
+ this.onSave()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$notify({
|
|
|
+ type: 'warning',
|
|
|
+ message: this.$t('common.formError')
|
|
|
+ })
|
|
|
+ this.$refs.form.scrollToField('title')
|
|
|
})
|
|
|
- this.$refs.form.scrollToField('title')
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
</script>
|
|
|
-<style lang="scss" sc>
|
|
|
- .ibps-notice-detail{
|
|
|
- .ibps-field__control--left{
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
- .notice-title{
|
|
|
- flex: 1;
|
|
|
- -webkit-box-flex: 1;
|
|
|
- display: flex;
|
|
|
- box-sizing: border-box;
|
|
|
- width: 100%;
|
|
|
- padding: 10px 16px;
|
|
|
- overflow: hidden;
|
|
|
- color: #323233;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 24px;
|
|
|
- background-color: #fff;
|
|
|
- }
|
|
|
- .notice-detailed{
|
|
|
- padding: 0px 16px;
|
|
|
- color: #969799;
|
|
|
- font-size: 12px !important;
|
|
|
- line-height: 18px;
|
|
|
- }
|
|
|
- .notice-publicItem{
|
|
|
- text-align:right;
|
|
|
- }
|
|
|
- .ibps-cell-wrapper{
|
|
|
- padding: 0;
|
|
|
- }
|
|
|
+<style lang="scss" scoped>
|
|
|
+.ibps-notice-detail {
|
|
|
+ .ibps-field__control--left {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .notice-title {
|
|
|
+ flex: 1;
|
|
|
+ -webkit-box-flex: 1;
|
|
|
+ display: flex;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 100%;
|
|
|
+ padding: 10px 16px;
|
|
|
+ overflow: hidden;
|
|
|
+ color: #323233;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 24px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ .notice-detailed {
|
|
|
+ padding: 0px 16px;
|
|
|
+ color: #969799;
|
|
|
+ font-size: 12px !important;
|
|
|
+ line-height: 18px;
|
|
|
+ }
|
|
|
+ .notice-publicItem {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .ibps-cell-wrapper {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+::v-deep
|
|
|
+ .scrollRestrict
|
|
|
+ .ibps-editor.van-cell.van-cell--borderless.van-field
|
|
|
+ .van-cell__value.van-field__value
|
|
|
+ .van-field__body
|
|
|
+ .van-field__control.van-field__control--left.van-field__control--custom
|
|
|
+ div {
|
|
|
+ overflow-x: scroll;
|
|
|
}
|
|
|
</style>
|