Commit 51ff8a482d0db73415bb2e279de7cd9f671d88a7

Authored by “wangming”
1 parent ecc43230

1

src/.DS_Store 0 → 100644
No preview for this file type
src/views/baseSpecialAction/FormPage.vue
... ... @@ -2,167 +2,116 @@
2 2 <div class="item-box common-info-box">
3 3 <div class="item-title">安排部署</div>
4 4 <div class="item-body">
5   - <div
6   - style="
  5 + <div style="
7 6 background-color: #fff;
8 7 width: 100%;
9 8 height: 100%;
10 9 padding: 15px;
11   - "
12   - >
  10 + ">
13 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 14 <el-col :span="24" v-if="false">
24 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 17 </el-input>
32 18 </el-form-item>
33 19 </el-col>
34 20 <el-col :span="24" v-if="ncc.hasFormP('specialActionType')">
35 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 26 </el-select>
50 27 </el-form-item>
51 28 </el-col>
52 29 <el-col :span="24" v-if="ncc.hasFormP('title')">
53 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 32 </el-input>
62 33 </el-form-item>
63 34 </el-col>
64 35 <el-col :span="24" v-if="ncc.hasFormP('content')">
65 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 39 </el-input>
75 40 </el-form-item>
76 41 </el-col>
77   - <el-col :span="24" v-if="ncc.hasFormP('releaseTime')">
  42 + <el-col :span="12">
78 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 46 </el-date-picker>
89 47 </el-form-item>
90 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 70 <el-col :span="24" v-if="ncc.hasFormP('annex')">
92 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 73 </NCC-UploadFz>
101 74 </el-form-item>
102 75 </el-col>
103 76 <el-col :span="24" v-if="ncc.hasFormP('communicationArea')">
104 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 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 86 </el-form-item>
117 87 </el-col>
118 88 <el-col :span="24" v-if="false">
119 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 91 </el-input>
127 92 </el-form-item>
128 93 </el-col>
129 94 <el-col :span="24" v-if="false">
130 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 97 </el-input>
137 98 </el-form-item>
138 99 </el-col>
139 100 <el-col :span="24" v-if="false">
140 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 103 </el-input>
147 104 </el-form-item>
148 105 </el-col>
149 106 <el-col :span="24" v-if="false">
150 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 109 </el-input>
157 110 </el-form-item>
158 111 </el-col>
159 112 <el-col :span="24" v-if="false">
160 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 115 </el-input>
167 116 </el-form-item>
168 117 </el-col>
... ... @@ -170,9 +119,7 @@
170 119 </el-row>
171 120 <span slot="footer" class="dialog-footer">
172 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 123 </span>
177 124 </div>
178 125 </div>
... ... @@ -191,12 +138,11 @@ export default {
191 138 visible: false,
192 139 isDetail: false,
193 140 dataForm: {
194   - id: "",
195 141 id: undefined,
196 142 specialActionType: undefined,
197 143 title: undefined,
198 144 content: undefined,
199   - releaseTime: undefined,
  145 + releaseTime: null,
200 146 annex: [],
201 147 communicationArea: [],
202 148 state: undefined,
... ... @@ -204,6 +150,7 @@ export default {
204 150 creatorTime: undefined,
205 151 lastModifyUserId: undefined,
206 152 lastModifyTime: undefined,
  153 + isOpenRelease:false,
207 154 },
208 155 rules: {
209 156 specialActionType: [
... ... @@ -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 188 specialActionTypeOptions: [],
225 189 communicationAreaOptions: [],
226 190 };
... ... @@ -229,14 +193,32 @@ export default {
229 193 watch: {},
230 194 created() {
231 195 this.getspecialActionTypeOptions();
  196 + this.getcommunicationAreaOptions();
232 197 },
233   - mounted() {},
  198 + mounted() { },
234 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 209 getspecialActionTypeOptions() {
236 210 getDictionaryDataSelector("576310654982423813").then((res) => {
237 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 222 goBack() {
241 223 this.$emit("refresh");
242 224 },
... ...