Commit 51ff8a482d0db73415bb2e279de7cd9f671d88a7
1 parent
ecc43230
1
Showing
2 changed files
with
88 additions
and
106 deletions
src/.DS_Store
0 → 100644
No preview for this file type
src/views/baseSpecialAction/FormPage.vue
| @@ -2,167 +2,116 @@ | @@ -2,167 +2,116 @@ | ||
| 2 | <div class="item-box common-info-box"> | 2 | <div class="item-box common-info-box"> |
| 3 | <div class="item-title">安排部署</div> | 3 | <div class="item-title">安排部署</div> |
| 4 | <div class="item-body"> | 4 | <div class="item-body"> |
| 5 | - <div | ||
| 6 | - style=" | 5 | + <div style=" |
| 7 | background-color: #fff; | 6 | background-color: #fff; |
| 8 | width: 100%; | 7 | width: 100%; |
| 9 | height: 100%; | 8 | height: 100%; |
| 10 | padding: 15px; | 9 | padding: 15px; |
| 11 | - " | ||
| 12 | - > | 10 | + "> |
| 13 | <el-row :gutter="15" class=""> | 11 | <el-row :gutter="15" class=""> |
| 14 | - <el-form | ||
| 15 | - ref="elForm" | ||
| 16 | - :model="dataForm" | ||
| 17 | - size="small" | ||
| 18 | - label-width="100px" | ||
| 19 | - label-position="right" | ||
| 20 | - :disabled="!!isDetail" | ||
| 21 | - :rules="rules" | ||
| 22 | - > | 12 | + <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" |
| 13 | + :disabled="!!isDetail" :rules="rules"> | ||
| 23 | <el-col :span="24" v-if="false"> | 14 | <el-col :span="24" v-if="false"> |
| 24 | <el-form-item label="主键" prop="id"> | 15 | <el-form-item label="主键" prop="id"> |
| 25 | - <el-input | ||
| 26 | - v-model="dataForm.id" | ||
| 27 | - placeholder="请输入" | ||
| 28 | - clearable | ||
| 29 | - :style="{ width: '100%' }" | ||
| 30 | - > | 16 | + <el-input v-model="dataForm.id" placeholder="请输入" clearable :style="{ width: '100%' }"> |
| 31 | </el-input> | 17 | </el-input> |
| 32 | </el-form-item> | 18 | </el-form-item> |
| 33 | </el-col> | 19 | </el-col> |
| 34 | <el-col :span="24" v-if="ncc.hasFormP('specialActionType')"> | 20 | <el-col :span="24" v-if="ncc.hasFormP('specialActionType')"> |
| 35 | <el-form-item label="类型" prop="specialActionType"> | 21 | <el-form-item label="类型" prop="specialActionType"> |
| 36 | - <el-select | ||
| 37 | - v-model="dataForm.specialActionType" | ||
| 38 | - placeholder="请选择" | ||
| 39 | - clearable | ||
| 40 | - required | ||
| 41 | - :style="{ width: '100%' }" | ||
| 42 | - > | ||
| 43 | - <el-option | ||
| 44 | - v-for="(item, index) in specialActionTypeOptions" | ||
| 45 | - :key="index" | ||
| 46 | - :label="item.fullName" | ||
| 47 | - :value="item.id" | ||
| 48 | - ></el-option> | 22 | + <el-select v-model="dataForm.specialActionType" placeholder="请选择" clearable required |
| 23 | + :style="{ width: '100%' }"> | ||
| 24 | + <el-option v-for="(item, index) in specialActionTypeOptions" :key="index" :label="item.fullName" | ||
| 25 | + :value="item.id"></el-option> | ||
| 49 | </el-select> | 26 | </el-select> |
| 50 | </el-form-item> | 27 | </el-form-item> |
| 51 | </el-col> | 28 | </el-col> |
| 52 | <el-col :span="24" v-if="ncc.hasFormP('title')"> | 29 | <el-col :span="24" v-if="ncc.hasFormP('title')"> |
| 53 | <el-form-item label="标题" prop="title"> | 30 | <el-form-item label="标题" prop="title"> |
| 54 | - <el-input | ||
| 55 | - v-model="dataForm.title" | ||
| 56 | - placeholder="请输入" | ||
| 57 | - clearable | ||
| 58 | - required | ||
| 59 | - :style="{ width: '100%' }" | ||
| 60 | - > | 31 | + <el-input v-model="dataForm.title" placeholder="请输入" clearable required :style="{ width: '100%' }"> |
| 61 | </el-input> | 32 | </el-input> |
| 62 | </el-form-item> | 33 | </el-form-item> |
| 63 | </el-col> | 34 | </el-col> |
| 64 | <el-col :span="24" v-if="ncc.hasFormP('content')"> | 35 | <el-col :span="24" v-if="ncc.hasFormP('content')"> |
| 65 | <el-form-item label="内容" prop="content"> | 36 | <el-form-item label="内容" prop="content"> |
| 66 | - <el-input | ||
| 67 | - v-model="dataForm.content" | ||
| 68 | - placeholder="请输入" | ||
| 69 | - show-word-limit | ||
| 70 | - :style="{ width: '100%' }" | ||
| 71 | - type="textarea" | ||
| 72 | - :autosize="{ minRows: 4, maxRows: 4 }" | ||
| 73 | - > | 37 | + <el-input v-model="dataForm.content" placeholder="请输入" show-word-limit :style="{ width: '100%' }" |
| 38 | + type="textarea" :autosize="{ minRows: 4, maxRows: 4 }"> | ||
| 74 | </el-input> | 39 | </el-input> |
| 75 | </el-form-item> | 40 | </el-form-item> |
| 76 | </el-col> | 41 | </el-col> |
| 77 | - <el-col :span="24" v-if="ncc.hasFormP('releaseTime')"> | 42 | + <el-col :span="12"> |
| 78 | <el-form-item label="发布时间" prop="releaseTime"> | 43 | <el-form-item label="发布时间" prop="releaseTime"> |
| 79 | - <el-date-picker | ||
| 80 | - v-model="dataForm.releaseTime" | ||
| 81 | - placeholder="请选择" | ||
| 82 | - clearable | ||
| 83 | - :style="{ width: '100%' }" | ||
| 84 | - type="datetime" | ||
| 85 | - format="yyyy-MM-dd HH:mm:ss" | ||
| 86 | - value-format="timestamp" | ||
| 87 | - > | 44 | + <el-date-picker v-model="dataForm.releaseTime" placeholder="请选择" clearable :style="{ width: '100%' }" |
| 45 | + type="datetime"> | ||
| 88 | </el-date-picker> | 46 | </el-date-picker> |
| 89 | </el-form-item> | 47 | </el-form-item> |
| 90 | </el-col> | 48 | </el-col> |
| 49 | + <el-col :span="12"> | ||
| 50 | + <el-form-item label="发布次数" prop="releaseCount"> | ||
| 51 | + <el-input-number v-model="dataForm.releaseCount" :min="1" :max="100"></el-input-number> | ||
| 52 | + </el-form-item> | ||
| 53 | + </el-col> | ||
| 54 | + <el-col :span="12"> | ||
| 55 | + <el-form-item label="发布周期" prop="releaseCount"> | ||
| 56 | + <el-select v-model="dataForm.releaseCycle" placeholder="请选择"> | ||
| 57 | + <el-option v-for="item in CycleOptions" :key="item.value" :label="item.label" :value="item.value"> | ||
| 58 | + </el-option> | ||
| 59 | + </el-select> | ||
| 60 | + </el-form-item> | ||
| 61 | + </el-col> | ||
| 62 | + <el-col :span="12"> | ||
| 63 | + <el-form-item label="自动发布" prop="isOpenRelease"> | ||
| 64 | + <el-radio-group v-model="dataForm.isOpenRelease"> | ||
| 65 | + <el-radio :label="true">是</el-radio> | ||
| 66 | + <el-radio :label="false">否</el-radio> | ||
| 67 | + </el-radio-group> | ||
| 68 | + </el-form-item> | ||
| 69 | + </el-col> | ||
| 91 | <el-col :span="24" v-if="ncc.hasFormP('annex')"> | 70 | <el-col :span="24" v-if="ncc.hasFormP('annex')"> |
| 92 | <el-form-item label="附件" prop="annex"> | 71 | <el-form-item label="附件" prop="annex"> |
| 93 | - <NCC-UploadFz | ||
| 94 | - v-model="dataForm.annex" | ||
| 95 | - :fileSize="5" | ||
| 96 | - sizeUnit="MB" | ||
| 97 | - :limit="9" | ||
| 98 | - buttonText="点击上传" | ||
| 99 | - > | 72 | + <NCC-UploadFz v-model="dataForm.annex" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传"> |
| 100 | </NCC-UploadFz> | 73 | </NCC-UploadFz> |
| 101 | </el-form-item> | 74 | </el-form-item> |
| 102 | </el-col> | 75 | </el-col> |
| 103 | <el-col :span="24" v-if="ncc.hasFormP('communicationArea')"> | 76 | <el-col :span="24" v-if="ncc.hasFormP('communicationArea')"> |
| 104 | <el-form-item label="传达区域" prop="communicationArea"> | 77 | <el-form-item label="传达区域" prop="communicationArea"> |
| 105 | - <el-checkbox-group | ||
| 106 | - v-model="dataForm.communicationArea" | ||
| 107 | - :style="{}" | ||
| 108 | - > | ||
| 109 | - <el-checkbox | ||
| 110 | - v-for="(item, index) in communicationAreaOptions" | ||
| 111 | - :key="index" | ||
| 112 | - :label="item.id" | ||
| 113 | - >{{ item.fullName }}</el-checkbox | ||
| 114 | - > | 78 | + <el-checkbox-group v-model="dataForm.communicationArea" :style="{}"> |
| 79 | + <el-checkbox v-for="(item, index) in communicationAreaOptions" :key="index" :label="item.id">{{ | ||
| 80 | + item.fullName }}</el-checkbox> | ||
| 115 | </el-checkbox-group> | 81 | </el-checkbox-group> |
| 82 | + <div style="margin-top: 10px;"> | ||
| 83 | + <el-button size="mini" @click="selectAll">全选</el-button> | ||
| 84 | + <el-button size="mini" @click="invertSelection">反选</el-button> | ||
| 85 | + </div> | ||
| 116 | </el-form-item> | 86 | </el-form-item> |
| 117 | </el-col> | 87 | </el-col> |
| 118 | <el-col :span="24" v-if="false"> | 88 | <el-col :span="24" v-if="false"> |
| 119 | <el-form-item label="状态" prop="state"> | 89 | <el-form-item label="状态" prop="state"> |
| 120 | - <el-input | ||
| 121 | - v-model="dataForm.state" | ||
| 122 | - placeholder="请输入" | ||
| 123 | - clearable | ||
| 124 | - :style="{ width: '100%' }" | ||
| 125 | - > | 90 | + <el-input v-model="dataForm.state" placeholder="请输入" clearable :style="{ width: '100%' }"> |
| 126 | </el-input> | 91 | </el-input> |
| 127 | </el-form-item> | 92 | </el-form-item> |
| 128 | </el-col> | 93 | </el-col> |
| 129 | <el-col :span="24" v-if="false"> | 94 | <el-col :span="24" v-if="false"> |
| 130 | <el-form-item label="创建用户" prop="creatorUserId"> | 95 | <el-form-item label="创建用户" prop="creatorUserId"> |
| 131 | - <el-input | ||
| 132 | - v-model="dataForm.creatorUserId" | ||
| 133 | - placeholder="系统自动生成" | ||
| 134 | - readonly | ||
| 135 | - > | 96 | + <el-input v-model="dataForm.creatorUserId" placeholder="系统自动生成" readonly> |
| 136 | </el-input> | 97 | </el-input> |
| 137 | </el-form-item> | 98 | </el-form-item> |
| 138 | </el-col> | 99 | </el-col> |
| 139 | <el-col :span="24" v-if="false"> | 100 | <el-col :span="24" v-if="false"> |
| 140 | <el-form-item label="创建时间" prop="creatorTime"> | 101 | <el-form-item label="创建时间" prop="creatorTime"> |
| 141 | - <el-input | ||
| 142 | - v-model="dataForm.creatorTime" | ||
| 143 | - placeholder="系统自动生成" | ||
| 144 | - readonly | ||
| 145 | - > | 102 | + <el-input v-model="dataForm.creatorTime" placeholder="系统自动生成" readonly> |
| 146 | </el-input> | 103 | </el-input> |
| 147 | </el-form-item> | 104 | </el-form-item> |
| 148 | </el-col> | 105 | </el-col> |
| 149 | <el-col :span="24" v-if="false"> | 106 | <el-col :span="24" v-if="false"> |
| 150 | <el-form-item label="修改用户" prop="lastModifyUserId"> | 107 | <el-form-item label="修改用户" prop="lastModifyUserId"> |
| 151 | - <el-input | ||
| 152 | - v-model="dataForm.lastModifyUserId" | ||
| 153 | - placeholder="系统自动生成" | ||
| 154 | - readonly | ||
| 155 | - > | 108 | + <el-input v-model="dataForm.lastModifyUserId" placeholder="系统自动生成" readonly> |
| 156 | </el-input> | 109 | </el-input> |
| 157 | </el-form-item> | 110 | </el-form-item> |
| 158 | </el-col> | 111 | </el-col> |
| 159 | <el-col :span="24" v-if="false"> | 112 | <el-col :span="24" v-if="false"> |
| 160 | <el-form-item label="修改时间" prop="lastModifyTime"> | 113 | <el-form-item label="修改时间" prop="lastModifyTime"> |
| 161 | - <el-input | ||
| 162 | - v-model="dataForm.lastModifyTime" | ||
| 163 | - placeholder="系统自动生成" | ||
| 164 | - readonly | ||
| 165 | - > | 114 | + <el-input v-model="dataForm.lastModifyTime" placeholder="系统自动生成" readonly> |
| 166 | </el-input> | 115 | </el-input> |
| 167 | </el-form-item> | 116 | </el-form-item> |
| 168 | </el-col> | 117 | </el-col> |
| @@ -170,9 +119,7 @@ | @@ -170,9 +119,7 @@ | ||
| 170 | </el-row> | 119 | </el-row> |
| 171 | <span slot="footer" class="dialog-footer"> | 120 | <span slot="footer" class="dialog-footer"> |
| 172 | <el-button @click="visible = false">取 消</el-button> | 121 | <el-button @click="visible = false">取 消</el-button> |
| 173 | - <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail" | ||
| 174 | - >确 定</el-button | ||
| 175 | - > | 122 | + <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button> |
| 176 | </span> | 123 | </span> |
| 177 | </div> | 124 | </div> |
| 178 | </div> | 125 | </div> |
| @@ -191,12 +138,11 @@ export default { | @@ -191,12 +138,11 @@ export default { | ||
| 191 | visible: false, | 138 | visible: false, |
| 192 | isDetail: false, | 139 | isDetail: false, |
| 193 | dataForm: { | 140 | dataForm: { |
| 194 | - id: "", | ||
| 195 | id: undefined, | 141 | id: undefined, |
| 196 | specialActionType: undefined, | 142 | specialActionType: undefined, |
| 197 | title: undefined, | 143 | title: undefined, |
| 198 | content: undefined, | 144 | content: undefined, |
| 199 | - releaseTime: undefined, | 145 | + releaseTime: null, |
| 200 | annex: [], | 146 | annex: [], |
| 201 | communicationArea: [], | 147 | communicationArea: [], |
| 202 | state: undefined, | 148 | state: undefined, |
| @@ -204,6 +150,7 @@ export default { | @@ -204,6 +150,7 @@ export default { | ||
| 204 | creatorTime: undefined, | 150 | creatorTime: undefined, |
| 205 | lastModifyUserId: undefined, | 151 | lastModifyUserId: undefined, |
| 206 | lastModifyTime: undefined, | 152 | lastModifyTime: undefined, |
| 153 | + isOpenRelease:false, | ||
| 207 | }, | 154 | }, |
| 208 | rules: { | 155 | rules: { |
| 209 | specialActionType: [ | 156 | specialActionType: [ |
| @@ -221,6 +168,23 @@ export default { | @@ -221,6 +168,23 @@ export default { | ||
| 221 | }, | 168 | }, |
| 222 | ], | 169 | ], |
| 223 | }, | 170 | }, |
| 171 | + CycleOptions: [ | ||
| 172 | + { | ||
| 173 | + value: '天', | ||
| 174 | + label: '天' | ||
| 175 | + }, { | ||
| 176 | + value: '月', | ||
| 177 | + label: '月' | ||
| 178 | + }, | ||
| 179 | + { | ||
| 180 | + value: '季', | ||
| 181 | + label: '季' | ||
| 182 | + }, | ||
| 183 | + { | ||
| 184 | + value: '年', | ||
| 185 | + label: '年' | ||
| 186 | + }, | ||
| 187 | + ], | ||
| 224 | specialActionTypeOptions: [], | 188 | specialActionTypeOptions: [], |
| 225 | communicationAreaOptions: [], | 189 | communicationAreaOptions: [], |
| 226 | }; | 190 | }; |
| @@ -229,14 +193,32 @@ export default { | @@ -229,14 +193,32 @@ export default { | ||
| 229 | watch: {}, | 193 | watch: {}, |
| 230 | created() { | 194 | created() { |
| 231 | this.getspecialActionTypeOptions(); | 195 | this.getspecialActionTypeOptions(); |
| 196 | + this.getcommunicationAreaOptions(); | ||
| 232 | }, | 197 | }, |
| 233 | - mounted() {}, | 198 | + mounted() { }, |
| 234 | methods: { | 199 | methods: { |
| 200 | + //查询所有区县 | ||
| 201 | + getcommunicationAreaOptions() { | ||
| 202 | + request({ | ||
| 203 | + url: "/extend/systeminformation/GetRegionList", | ||
| 204 | + method: "get", | ||
| 205 | + }).then((res) => { | ||
| 206 | + this.communicationAreaOptions = res.data; | ||
| 207 | + }); | ||
| 208 | + }, | ||
| 235 | getspecialActionTypeOptions() { | 209 | getspecialActionTypeOptions() { |
| 236 | getDictionaryDataSelector("576310654982423813").then((res) => { | 210 | getDictionaryDataSelector("576310654982423813").then((res) => { |
| 237 | this.specialActionTypeOptions = res.data.list; | 211 | this.specialActionTypeOptions = res.data.list; |
| 238 | }); | 212 | }); |
| 239 | }, | 213 | }, |
| 214 | + selectAll() { | ||
| 215 | + this.dataForm.communicationArea = this.communicationAreaOptions.map(option => option.id); | ||
| 216 | + }, | ||
| 217 | + invertSelection() { | ||
| 218 | + this.dataForm.communicationArea = this.communicationAreaOptions | ||
| 219 | + .filter(option => !this.dataForm.communicationArea.includes(option.id)) | ||
| 220 | + .map(option => option.id); | ||
| 221 | + }, | ||
| 240 | goBack() { | 222 | goBack() { |
| 241 | this.$emit("refresh"); | 223 | this.$emit("refresh"); |
| 242 | }, | 224 | }, |