Commit 12ff398d25cacaef245f87e0cad2fbb002a1100b

Authored by monkeyhouyi
1 parent 1dbea7ff

优化

src/main.js
... ... @@ -19,6 +19,7 @@ import store from './store'
19 19 import './permission'
20 20 import moment from "moment";
21 21 import i18n from './lang' // internationalization
  22 +import selectLoadMore from '@/utils/loadmore.js';
22 23  
23 24  
24 25 Vue.config.productionTip = false
... ... @@ -44,20 +45,7 @@ Object.keys(filters).forEach(key => {
44 45 })
45 46  
46 47 Vue.config.productionTip = false
47   -
48   -Vue.directive('loadMore', {
49   - bind(el, binding) {
50   - // 获取element-ui定义好的scroll盒子
51   - const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
52   - SELECTWRAP_DOM.addEventListener('scroll', function () {
53   -
54   - const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight
55   - if (CONDITION) {
56   - binding.value()
57   - }
58   - })
59   - }
60   -})
  48 +Vue.directive('selectLoadMore', selectLoadMore)
61 49 Vue.directive('removeAriaHidden', {
62 50 bind(el, binding) {
63 51 let ariaEls = el.querySelectorAll('.el-radio__original');
... ...
src/utils/loadmore.js 0 → 100644
  1 +export default {
  2 + bind(el, binding) {
  3 + const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
  4 + selectDom.addEventListener('scroll', () => {
  5 + if (selectDom.scrollHeight - selectDom.scrollTop <= selectDom.clientHeight + 20) {
  6 + binding.value()
  7 + }
  8 + })
  9 + }
  10 +};
0 11 \ No newline at end of file
... ...
src/views/DisposalSuggestions/index.vue
... ... @@ -68,6 +68,21 @@
68 68 </div>
69 69 </el-upload>
70 70 <el-button type="primary" icon="el-icon-download" size="mini" @click="exportData()" >导出</el-button>
  71 + <el-button v-if="!isSHILevel" type="primary" icon="el-icon-download" size="mini" @click="exportMakeDemo()">导出处理模板</el-button>
  72 + <el-upload
  73 + v-if="!isSHILevel"
  74 + class="uploadXlax"
  75 + :action="define.APIURl + '/api/Extend/BaseInspectionReport/TaskBatchReport'"
  76 + :headers="uploadHeaders"
  77 + :on-success="uploadSuccess"
  78 + :on-error="uploadError"
  79 + :show-file-list="false"
  80 + name="excelfile"
  81 + >
  82 + <div class="avatar-box">
  83 + <el-button type="info" icon="el-icon-upload" size="mini">批量上报</el-button>
  84 + </div>
  85 + </el-upload>
71 86 </div>
72 87 <div class="NCC-common-layout-main NCC-flex-main">
73 88 <NCC-table v-loading="listLoading" :data="list">
... ... @@ -79,7 +94,7 @@
79 94 <template slot-scope="scope">{{ scope.row.reportSource | dynamicTextUP(sourceOptions) }}</template>
80 95 </el-table-column>
81 96 <el-table-column show-overflow-tooltip label="问题类型" prop="questionType" align="left"/>
82   - <el-table-column show-overflow-tooltip label="线索编号" prop="leadNumber" align="left"/>
  97 + <el-table-column show-overflow-tooltip label="线索编号" prop="leadNumber" align="left" width="180"/>
83 98 <!-- <el-table-column show-overflow-tooltip prop="link" label="有害链接" align="left" /> -->
84 99 <!-- <el-table-column show-overflow-tooltip prop="questionClass" label="关键词" align="left" /> -->
85 100 <el-table-column show-overflow-tooltip prop="creatorTime" label="录入时间" align="left" :formatter="ncc.tableDateFormat"/>
... ... @@ -216,13 +231,19 @@ export default {
216 231 });
217 232 this.sourceOptions = data;
218 233 },
  234 + getTime() {
  235 + if(!this.query.creatorTime) return;
  236 + return {
  237 + startTime: this.query.creatorTime[0] || '',
  238 + endTime: this.query.creatorTime[1] || '',
  239 + }
  240 + },
219 241 initData() {
220 242 this.listLoading = true;
221 243 let _query = {
222 244 ...this.listQuery,
223 245 ...this.query,
224   - startTime: this.query.creatorTime[0] || '',
225   - endTime: this.query.creatorTime[1] || '',
  246 + ...this.getTime()
226 247 };
227 248 let query = {};
228 249 for (let key in _query) {
... ... @@ -344,16 +365,33 @@ export default {
344 365 link.click();
345 366 });
346 367 },
347   - uploadSuccess(response, file, fileList) {
348   - this.$message({
349   - showClose: true,
350   - message: response.msg,
351   - type: response.code == 200 ? 'success' : 'error',
352   - close: () => {
353   - response.code == 200 && this.initData();
354   - }
  368 + exportMakeDemo() {
  369 + let obj = {
  370 + url: '/Extend/BaseInspectionReport/Actions/GenerateImportTemplateBatchReport',
  371 + method: "GET",
  372 + responseType: 'blob',
  373 + };
  374 + request(obj).then((res) => {
  375 + const blob = new Blob([res], {type: 'application/json'});
  376 + const url = window.URL.createObjectURL(blob);
  377 + let link = document.createElement('a');
  378 + link.style.display = 'none';
  379 + link.href = url;
  380 + link.download = '处理表单模板.xlsx';
  381 + link.click();
355 382 });
356 383 },
  384 + uploadSuccess(response, file, fileList) {
  385 + if(response.code == 200) {
  386 + this.$message({
  387 + message: response.msg,
  388 + type: 'success'
  389 + });
  390 + } else {
  391 + this.$message.error(response.msg);
  392 + }
  393 + response.code == 200 && this.initData();
  394 + },
357 395 uploadError() {
358 396 console.log('erroe');
359 397 },
... ...
src/views/baseCaseHandling/Form.vue
... ... @@ -45,11 +45,15 @@
45 45 style="width: 100%"
46 46 @blur.native.capture="selectCompanyBlur"
47 47 @visible-change="visibleNameCompanyChange"
48   - :disabled="formType != 0"
49 48 @change="(val) => companyChange(val, 'change')"
  49 + :disabled="formType != 0"
  50 + v-selectLoadMore="moreCompanyList"
  51 + :loading="name_loading"
  52 + :teleported="false"
  53 + :filter-method="filterMethod"
50 54 >
51 55 <el-option
52   - v-for="item in companyOptions"
  56 + v-for="item in companyOptions.slice(0, company_currentPage)"
53 57 :key="item.id"
54 58 :label="item.companyName"
55 59 :value="item.id"
... ... @@ -71,8 +75,10 @@
71 75 @visible-change="visibleNameChange"
72 76 @change="(val) => platformNameChange(val, 'change')"
73 77 :disabled="formType != 0 || !dataForm.registeredEntity"
  78 + v-selectLoadMore="moreSystemList"
  79 + :teleported="false"
74 80 :loading="system_loading">
75   - <el-option v-for="item in systemOption" :key="item.value" :label="item.systemName" :value="item.id" />
  81 + <el-option v-for="item in systemOption.slice(0, system_currentPage)" :key="item.value" :label="item.systemName" :value="item.id" />
76 82 </el-select>
77 83 </el-form-item>
78 84 </el-col>
... ... @@ -432,6 +438,9 @@ export default {
432 438 btnLoading: false,
433 439 companyOptions: [],
434 440 platformTypeOptions: [],
  441 + company_currentPage: 20,
  442 + name_loading: false,
  443 + system_currentPage: 20,
435 444 };
436 445 },
437 446 computed: {
... ... @@ -463,6 +472,23 @@ export default {
463 472 this.companyOptions = data;
464 473 })
465 474 },
  475 + moreCompanyList() {
  476 + if(this.company_currentPage > this.companyOptions.length) return;
  477 + this.company_currentPage += 10;
  478 + },
  479 + async filterMethod(val) {
  480 + this.company_currentPage = 20;
  481 + this.name_loading = true
  482 + let companyRes = await request({
  483 + url: `/Extend/basecomapnyinfo/GetNoPagingList`,
  484 + method: "GET",
  485 + params: {
  486 + companyName: val
  487 + }
  488 + });
  489 + this.companyOptions = companyRes.data;
  490 + this.name_loading = false;
  491 + },
466 492 // 获取系统列表
467 493 getSystemSelect(companyId) {
468 494 this.system_loading = true;
... ... @@ -475,6 +501,26 @@ export default {
475 501 this.system_loading = false;
476 502 })
477 503 },
  504 + moreSystemList() {
  505 + if(this.system_currentPage > this.systemOption.length) return;
  506 + this.system_currentPage += 10;
  507 + },
  508 + async filterMethod_system(val) {
  509 + this.system_currentPage = 0;
  510 + this.system_loading = true;
  511 + this.systemOption.filter.includes
  512 + request({
  513 + url: "/Extend/basesysteminfo/GetNoPagingList",
  514 + method: "get",
  515 + params: {
  516 + companyId: this.dataForm.registeredEntity,
  517 + systemName: val,
  518 + }
  519 + }).then(({data}) => {
  520 + this.systemOption = data;
  521 + this.system_loading = false;
  522 + })
  523 + },
478 524 selectBlur(e) {
479 525 let value = e.target.value;
480 526 if(!value) return;
... ...
src/views/baseCaseHandling/index.vue
... ... @@ -183,7 +183,7 @@ export default {
183 183 },
184 184 },
185 185 created() {
186   - this.initSystemOptions();
  186 + // this.initSystemOptions();
187 187 this.initSystemTypeList();
188 188 this.initAreaTypeList();
189 189 this.initStateTypeOption();
... ... @@ -203,13 +203,19 @@ export default {
203 203 this.listQuery.sidx = !order ? "" : prop;
204 204 this.initData();
205 205 },
  206 + getTime() {
  207 + if(!this.query.registrationTime) return;
  208 + return {
  209 + startTime: this.query.registrationTime[0] || '',
  210 + endTime: this.query.registrationTime[1] || '',
  211 + }
  212 + },
206 213 initData() {
207 214 this.listLoading = true;
208 215 let _query = {
209 216 ...this.listQuery,
210 217 ...this.query,
211   - startTime: this.query.registrationTime[0] || '',
212   - endTime: this.query.registrationTime[1] || '',
  218 + ...this.getTime()
213 219 };
214 220 let query = {};
215 221 for (let key in _query) {
... ...
src/views/baseInspectionReport/Form.vue
... ... @@ -45,8 +45,12 @@
45 45 @visible-change="visibleNameCompanyChange"
46 46 @change="(val) => companyChange(val, 'change')"
47 47 :disabled='!!this.dataForm.id'
  48 + v-selectLoadMore="initCompanyList"
  49 + :loading="name_loading"
  50 + :teleported="false"
  51 + :filter-method="filterMethod"
48 52 >
49   - <el-option v-for="item in companyOptions" :key="item.id" :label="item.companyName" :value="item.id"/>
  53 + <el-option v-for="item in companyOptions.slice(0, company_currentPage)" :key="item.id" :label="item.companyName" :value="item.id"/>
50 54 </el-select>
51 55 </el-form-item>
52 56 </el-col>
... ... @@ -62,9 +66,11 @@
62 66 @blur.native.capture="selectBlur"
63 67 @visible-change="visibleNameChange"
64 68 @change="(val) => platformNameChange(val, 'change')"
65   - :loading="name_loading"
  69 + v-selectLoadMore="moreSystemList"
  70 + :teleported="false"
  71 + :loading="system_loading"
66 72 :disabled="!!this.dataForm.id || !dataForm.company">
67   - <el-option v-for="item in nameOptions" :key="item.id" :label="item.systemName" :value="item.id"></el-option>
  73 + <el-option v-for="item in nameOptions.slice(0, system_currentPage)" :key="item.id" :label="item.systemName" :value="item.id"></el-option>
68 74 </el-select>
69 75 </el-form-item>
70 76 </el-col>
... ... @@ -364,6 +370,10 @@ export default {
364 370 companyOptions: [],
365 371 btnLoading: false,
366 372 areaOptions: [],
  373 + company_currentPage: 20,
  374 + system_loading: false,
  375 + system_currentPage: 20,
  376 + system_loading: false,
367 377 };
368 378 },
369 379 computed: {
... ... @@ -402,12 +412,21 @@ export default {
402 412 // this.name_loading = false;
403 413 },
404 414 async initCompanyList() {
405   - request({
  415 + if(this.company_currentPage > this.companyOptions.length) return;
  416 + this.company_currentPage += 10;
  417 + },
  418 + async filterMethod(val) {
  419 + this.company_currentPage = 20;
  420 + this.name_loading = true
  421 + let companyRes = await request({
406 422 url: `/Extend/basecomapnyinfo/GetNoPagingList`,
407 423 method: "GET",
408   - }).then(({data}) => {
409   - this.companyOptions = data;
410   - })
  424 + params: {
  425 + companyName: val
  426 + }
  427 + });
  428 + this.companyOptions = companyRes.data;
  429 + this.name_loading = false;
411 430 },
412 431 selectBlur(e) {
413 432 let value = e.target.value;
... ... @@ -474,6 +493,10 @@ export default {
474 493 this.name_loading = false;
475 494 })
476 495 },
  496 + moreSystemList() {
  497 + if(this.system_currentPage > this.nameOptions.length) return;
  498 + this.system_currentPage += 10;
  499 + },
477 500 async getplatformTypeOptions() {
478 501 let list = this.$store.state.meta.system;
479 502 !list && (list = await this.$store.dispatch("getTypeListByCode", "system"));
... ...
src/views/baseInspectionReport/index.vue
... ... @@ -59,6 +59,7 @@
59 59 </div>
60 60 </el-upload>
61 61 <el-button type="primary" icon="el-icon-download" size="mini" @click="exportData()">导出</el-button>
  62 +
62 63 </div>
63 64 </el-form>
64 65 </el-row>
... ... @@ -229,7 +230,7 @@
229 230 let obj = {}
230 231 if(type) {
231 232 obj = {
232   - url: '/Extend/BaseInspectionReport/Actions/GenerateImportTemplate',
  233 + url: type == 'demo' ? '/Extend/BaseInspectionReport/Actions/GenerateImportTemplate' : '/Extend/BaseInspectionReport/Actions/GenerateImportTemplateBatchReport',
233 234 method: "GET",
234 235 responseType: 'blob',
235 236 }
... ... @@ -262,7 +263,7 @@
262 263 let link = document.createElement('a');
263 264 link.style.display = 'none';
264 265 link.href = url;
265   - link.download = '线索录入模板.xlsx';
  266 + link.download = type == 'demo' ? '线索录入模板.xlsx' : '处理表单模板.xlsx';
266 267 link.click();
267 268 } else {
268 269 if(res.code != 200) return;
... ...
src/views/baseListHazardousSamples/index.vue
... ... @@ -42,9 +42,14 @@
42 42 v-model="query.company"
43 43 placeholder="请选择运营主体"
44 44 clearable
  45 + filterable
  46 + v-selectLoadMore="moreCompanyList"
  47 + :loading="name_loading"
  48 + :teleported="false"
  49 + :filter-method="filterMethod"
45 50 >
46 51 <el-option
47   - v-for="(item, index) in companyOptions"
  52 + v-for="(item, index) in companyOptions.slice(0, company_currentPage)"
48 53 :key="index"
49 54 :label="item.companyName"
50 55 :value="item.id"
... ... @@ -158,6 +163,8 @@ export default {
158 163 exportBtnLoading: false,
159 164 HandFormVisible: false,
160 165 ReportFormVisible: false,
  166 + company_currentPage: 20,
  167 + name_loading: false,
161 168 };
162 169 },
163 170 computed: {},
... ... @@ -167,11 +174,29 @@ export default {
167 174 },
168 175 methods: {
169 176 getcompanyOptions() {
  177 + this.name_loading = true;
170 178 request({
171 179 url: `/Extend/basecomapnyinfo/GetNoPagingList`,
172 180 method: "GET",
173 181 }).then(({data}) => {
174 182 this.companyOptions = data;
  183 + this.name_loading = false;
  184 + })
  185 + },
  186 + moreCompanyList() {
  187 + if(this.company_currentPage > this.companyOptions.length) return
  188 + this.company_currentPage += 10;
  189 + },
  190 + filterMethod(val) {
  191 + this.company_currentPage = 20;
  192 + this.name_loading = true;
  193 + request({
  194 + url: `/Extend/basecomapnyinfo/GetNoPagingList`,
  195 + method: "GET",
  196 + params: { companyName: val }
  197 + }).then(({data}) => {
  198 + this.companyOptions = data;
  199 + this.name_loading = false;
175 200 })
176 201 },
177 202 initData() {
... ...