index.html
@@ -9,15 +9,14 @@ <body> <div id="app"></div> </body> <script type="text/javascript"> <!-- <script type="text/javascript"> window._AMapSecurityConfig = { serviceHost: 'http://47.100.191.150:8083/_AMapService' //ä¾å¦ ï¼serviceHost:'http://1.1.1.1:80/_AMapService', }; </script> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.5&key=520c5e5cf44c7793104e500cbf0ed711&plugin=Map3D,ElasticMarker,AMap.ControlBar,AMap.Geocoder" ></script> ></script> --> <script type="module" src="/src/main.js"></script> </html> src/api/fysp/problemApi.js
@@ -5,12 +5,30 @@ export default { /** * è·ååä»»å¡é®é¢è¯¦æ */ getProBySubtask(id) { return $fysp .get('problemlist/subtask', { params: { stGuid: id } }) .then((res) => res.data); }, /** * é®é¢å®¡æ ¸ * @param {Number} action 0ï¼é®é¢éè¿ï¼1ï¼é®é¢ä¸éè¿ï¼2ï¼æ´æ¹éè¿ï¼3æ´æ¹ä¸éè¿ */ checkProblem({ pId, action, remark = '', userId = id, userName = name }) { const params = `?pId=${pId}&action=${action}&remark=${remark}&userId=${userId}&userName=${userName}`; return $fysp.post(`problemlist/check${params}`).then((res) => res.data); // const params = `?pId=${pId}&action=${action}&remark=${remark}&userId=${userId}&userName=${userName}`; return $fysp .post( `problemlist/check`, {}, { params: { pId, action, remark, userId, userName } } ) .then((res) => res.data); }, fetchProblemType({ cityCode, districtCode, sceneTypeId }) { @@ -26,7 +44,7 @@ return $fysp.get(`mediafile/${params}/5`).then((res) => res); }, // è·åé®é¢ä½ç½® getLocation({ sceneTypeId }) { getLocation({ sceneTypeId }) { const params = `?sceneType=${sceneTypeId}`; return $fysp.get(`domainitem/location${params}`).then((res) => res); }, @@ -35,23 +53,23 @@ return $fysp.get(`changeadvice`).then((res) => res); }, // ä¿®æ¹é®é¢ updateProblem(data) { updateProblem(data) { return $fysp.post(`problemlist/updateProblem`, data).then((res) => res); }, // æ°å¢é®é¢ newProblem(data) { return $fysp.post(`problemlist/newProblem`, data).then((res) => res) return $fysp.post(`problemlist/newProblem`, data).then((res) => res); }, // ä¿®æ¹æ´æ¹ updateChange(data) { return $fysp.post(`problemlist/updateChange`, data).then((res) => res) return $fysp.post(`problemlist/updateChange`, data).then((res) => res); }, // æ´æ¹ä¸ä¼ changeProblem(data) { return $fysp.post(`problemlist/changeProblem`, data).then((res) => res) return $fysp.post(`problemlist/changeProblem`, data).then((res) => res); }, // é®é¢å é¤ deleteProblem({ pid }) { return $fysp.post(`problemlist/${pid}`).then((res) => res.data) return $fysp.post(`problemlist/${pid}`, {}).then((res) => res.data); } } }; src/api/fysp/userApi.js
@@ -28,7 +28,7 @@ * èªå¨åå»ºè´¦æ· */ autoCreateAccount(sId) { return $fysp.post(`userinfo/create?sceneId=${sId}`).then((res) => res.data); return $fysp.post(`userinfo/create?sceneId=${sId}`, {}).then((res) => res.data); }, /** * è·ååºæ¯å¯¹åºçé£ç¾½ç¯å¢ç³»ç»ç¨æ·id src/api/fytz/userApi.js
@@ -45,7 +45,7 @@ * éç½®ç¨æ·å¯ç */ resetPassword(id) { return $fytz.post(`userInfo/resetPw?userId=${id}`).then((res) => res.data); return $fytz.post(`userInfo/resetPw?userId=${id}`, {}).then((res) => res.data); }, src/api/index.js
@@ -7,11 +7,13 @@ // let ip1_file = 'http://47.100.191.150:9005/'; let ip1 = 'https://fyami.com.cn:447/'; let ip1_file = 'https://fyami.com.cn:447/'; // let ip1 = 'https://fyami.com.cn:449/api/'; // let ip1_file = 'https://fyami.com.cn:449/api/'; let ip2 = 'https://fyami.com.cn/'; let ip2_file = 'https://fyami.com.cn/'; if (debug) { ip1 = 'http://192.168.0.110:9001/'; ip1 = 'http://192.168.0.103:8080/'; // ip1_file = 'http://192.168.0.138:8080/'; // ip2 = 'http://192.168.0.138:8080/'; // ip2_file = 'https://fyami.com.cn/'; src/components.d.ts
@@ -13,15 +13,19 @@ CompGenericWrapper: typeof import('./components/CompGenericWrapper.vue')['default'] CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default'] Content: typeof import('./components/core/Content.vue')['default'] ElAffix: typeof import('element-plus/es')['ElAffix'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCalendar: typeof import('element-plus/es')['ElCalendar'] ElCard: typeof import('element-plus/es')['ElCard'] ElCascader: typeof import('element-plus/es')['ElCascader'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] @@ -33,6 +37,9 @@ ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] @@ -42,13 +49,17 @@ ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElLink: typeof import('element-plus/es')['ElLink'] ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] ElOption: typeof import('element-plus/es')['ElOption'] ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] @@ -67,6 +78,7 @@ ElTag: typeof import('element-plus/es')['ElTag'] ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTransfer: typeof import('element-plus/es')['ElTransfer'] ElTree: typeof import('element-plus/es')['ElTree'] ElUpload: typeof import('element-plus/es')['ElUpload'] Footer: typeof import('./components/core/Footer.vue')['default'] src/components/CompGenericWrapper.vue
@@ -9,6 +9,7 @@ destroy-on-close :draggable="draggable" :modal="modal" :append-to-body="appendToBody" > <div v-if="visible"> <slot name="content"></slot> @@ -45,6 +46,10 @@ modal: { type: Boolean, default: true }, appendToBody: { type: Boolean, default: true } }); const typeOptions = ref([ src/components/FYImageSelectDialog.vue
@@ -39,17 +39,24 @@ </el-row> <div class="center"> <el-tabs v-if="typeList.length > 0" v-model="activeId" type="card"> <el-tab-pane v-for="item in typeList" :key="item.typeId" :label=" item.typeName + ' (' + typeImgMap.get(item.typeId).length + ')' " :name="item.typeId" <el-scrollbar class="scrollbar-flex-content"> <el-tabs v-if="typeList.length > 0" v-model="activeId" type="card" stretch > </el-tab-pane> </el-tabs> <el-tab-pane v-for="item in typeList" :key="item.typeId" :label=" item.typeName + ' (' + typeImgMap.get(item.typeId).length + ')' " :name="item.typeId" > </el-tab-pane> </el-tabs> </el-scrollbar> <el-scrollbar height="70vh"> <div v-if="typeImgMap.get(activeId) && typeImgMap.get(activeId).length > 0" @@ -216,6 +223,10 @@ ); </script> <style scoped> .scrollbar-flex-content { display: flex; width: 100%; } .center { display: flex; flex-direction: column; src/components/list-item/ItemSubTask.vue
@@ -60,7 +60,7 @@ </template> <script setup> import { ref, watch, computed } from 'vue'; import taskApi from '@/api/fysp/taskApi'; import problemApi from '@/api/fysp/problemApi'; import ProCheckProxy from '@/views/fysp/check/ProCheckProxy'; /** @@ -128,7 +128,7 @@ function fetchProblems(subtask) { loading.value = true; taskApi problemApi .getProBySubtask(subtask.stguid) .then((res) => { proList.value = res; src/components/table/FYTable.vue
@@ -28,6 +28,7 @@ <slot name="options-expand2"></slot> </div> <el-table id="fyTable" ref="tableRef" :data="tableData" v-loading="loading" @@ -78,6 +79,14 @@ size: { type: String, default: 'default' }, data: { type: Array, default: () => [] }, totalCount: { type: Number, default: 0 } }, data() { @@ -110,13 +119,25 @@ } }, immediate: true }, data(nValue, oValue) { if (nValue != oValue) { this.tableData = nValue; } }, totalCount(nValue, oValue) { if (nValue != oValue) { this.total = nValue; } } }, computed: { cTableHeight() { if (this.$refs.searchRef) { const h1 = this.$refs.searchRef.$el.offsetHeight; const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0; const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0; const h3 = this.$refs.expandRef.$el.offsetHeight; const h4 = this.$refs.expand2Ref.offsetHeight; @@ -143,8 +164,14 @@ pageSize: this.pageSize }, (res) => { this.tableData = res.data; this.total = res.total ? res.total : 0; if (res) { if (res.data) { this.tableData = res.data; } if (res.total) { this.total = res.total; } } this.loading = false; this.doLayout(); } @@ -152,7 +179,9 @@ }, calcTableHeight() { const h1 = this.$refs.searchRef.$el.offsetHeight; const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0; const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0; const h3 = this.$refs.expandRef.$el.offsetHeight; const h4 = this.$refs.expand2Ref.offsetHeight; @@ -183,7 +212,7 @@ handleSortChange({ column, prop, order }) { this.$emit('sortChange', { column, prop, order }); }, clearSort(){ clearSort() { this.$refs.tableRef.clearSort(); } }, src/utils/excel.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,48 @@ import * as XLSX from 'xlsx'; import FileSaver from 'file-saver'; function conversionFromTable(elementId, title) { // è·åè¡¨æ ¼å ç´ let list = document.getElementById(elementId); let tables = list.cloneNode(true); //å 鿤å ç´ ï¼å¦åæ´æ¹æ°æ®æ¶ä¼å½±åå°åè¡¨æ ¼ //å¦æè¡¨æ ¼ä¸å«æswitchå¼å ³ï¼æ¾å ¥ä»¥ä¸ä»£ç ï¼å¯è½¬æ¢ç¶æä¼å¨Excel䏿¾ç¤ºï¼å¦å转æ¢åºæ¥ä¸ºç©ºï¼ä¸ä¼å¨Excel䏿¾ç¤º // const rows = tables.getElementsByTagName('tr'); // for (let i = 1; i < rows.length; i++) { // // ä»1å¼å§ï¼ä»¥è·³è¿è¡¨å¤´ // const cells = rows[i].getElementsByTagName('td'); // for (let j = 0; j < cells.length; j++) { // const cell = cells[j]; // // æ¾å°å¼å ³å ç´ å¹¶è·åç¶æ // const switchElement = cell.querySelector('input[type="checkbox"]'); // if (switchElement) { // // æ ¹æ®å¼å ³ç¶æè®¾ç½®åå æ ¼å 容 // cells[j].innerText = switchElement.checked ? 'å ³é' : 'å¼å¯'; // } // } // } console.log(tables); //------æ¾å ¥ä»¥ä¸æ¿å°switchç¶æï¼ä»¥å䏿æ¡ä»£ç ï¼å¦ææ²¡å éå ç´ åä¼å½±åå°åè¡¨æ ¼-------------// // 导åºè¡¨æ ¼ var xlsxParam = { raw: true }; // 导åºçå 容åªåè§£æï¼ä¸è¿è¡æ ¼å¼è½¬æ¢ let table_book = XLSX.utils.table_to_book(tables, xlsxParam); const table_write = XLSX.write(table_book, { bookType: 'xlsx', bookSST: true, type: 'array' }); try { FileSaver.saveAs( new Blob([table_write], { type: 'application/octet-stream' }), `${title}.xlsx` //ä¿®æ¹åå ); //è¿éå¯ä»¥æ¾å ¥ä½ çåè°å½æ° alert('å¼å§ä¸è½½'); } catch (e) { if (typeof console !== 'undefined') console.log(e, table_write); } return table_write; } export { conversionFromTable }; src/views/fysp/check/ProCheck.vue
@@ -81,6 +81,7 @@ <script> import ArbitraryPhoto from './components/ArbitraryPhoto.vue'; import taskApi from '@/api/fysp/taskApi'; import problemApi from '@/api/fysp/problemApi'; import ProCheckProxy from './ProCheckProxy'; import CompProblemAddOrUpd from './components/CompProblemAddOrUpd.vue'; import CompProblemCard from './components/CompProblemCard.vue'; @@ -217,7 +218,7 @@ this.sideLoading = false; this.mainLoading = true; // const controller = new AbortController(); taskApi problemApi .getProBySubtask(s.data.stGuid) .then((res) => { this.curProList = res; @@ -242,7 +243,7 @@ this.sideLoading = false; setTimeout(() => { this.mainLoading = true; taskApi problemApi .getProBySubtask(this.curSubtask.data.stGuid) .then((res) => { if (refresh) { src/views/fysp/check/components/ArbitraryPhoto.vue
@@ -218,7 +218,7 @@ canvas.width = img.naturalWidth; canvas.height = img.naturalHeight; ctx.drawImage(img, 0, 0, canvas.width, canvas.height); // this.copyCanvasToClipboard(canvas); this.copyCanvasToClipboard(canvas); const dataUrl = canvas.toDataURL('image/png'); // å¯ä»¥éæ©å ¶ä»æ ¼å¼å¦'image/jpeg' // å建ä¸ä¸ªä¸´æ¶çtextareaå ç´ æ¥å¤å¶ææ¬ const tempTextArea = document.createElement('textarea'); src/views/fysp/check/components/CompProRecent.vue
@@ -57,6 +57,7 @@ <script> import CompProblemAddOrUpd from './CompProblemAddOrUpd.vue'; import taskApi from '@/api/fysp/taskApi'; import problemApi from '@/api/fysp/problemApi'; import { useCloned } from '@vueuse/core'; import dayjs from 'dayjs'; export default { @@ -180,7 +181,7 @@ }, // æ ¹æ®åä»»å¡è·åéé¢çé®é¢å表 getProBySubtask(subtask) { return taskApi.getProBySubtask(subtask.stGuid).then((pros) => { return problemApi.getProBySubtask(subtask.stGuid).then((pros) => { if (pros) { pros.forEach((pro) => { if (pro.ptguid == this.deepCopyPro.ptguid) { src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -1,5 +1,5 @@ <template> <CompGenericWrapper type="dialog"> <CompGenericWrapper type="dialog" append-to-body> <template #content> <div class="main-container"> <el-form src/views/fysp/data-product/ProdLawEnforceList.vue
@@ -1,12 +1,12 @@ <template> <FYTable @search="onSearch" :data="tableData" :pagination="false" ref="tableRef" @cell-click="cellClick" :cell-class-name="cellClassName" @table-paste="handlePaste" @sort-change="handleSortChange" > <template #options> <!-- åºå¿ --> @@ -34,18 +34,36 @@ <el-form :inline="true"> <CompQuickSet @quick-set="setOptions"></CompQuickSet> </el-form> <el-descriptions v-if="this.tableData.length > 0" title="" :column="1" direction="vertical" border> <el-descriptions v-if="this.tableData.length > 0" title="" :column="1" direction="vertical" border > <el-descriptions-item label="èåæ§æ³æ¸ å"> {{ listSummary }} </el-descriptions-item> </el-descriptions> </template> <template #buttons> <el-button icon="Download" type="primary" plain @click="download" :loading="dlLoading" :disabled="downloadDisabled" >ä¸è½½æ¸ å</el-button > </template> <template #table-column="{ size }"> <el-table-column fixed="left" label="åºå·" width="80"> <el-table-column fixed="left" label="åºå·" width="53"> <template #default="{ row }"> {{ row.index + 1 }} </template> </el-table-column> <el-table-column fixed="left" label="ç¼å·" width="53" prop="sceneIndex"> </el-table-column> <el-table-column prop="sceneName" @@ -53,6 +71,23 @@ label="åç§°" width="300" > </el-table-column> <el-table-column prop="evaluation.scenseaddress" label="å°å" /> <el-table-column prop="_problems" label="é®é¢" width="300"> <template #default="{ row }"> <el-icon class="is-loading" v-if="row._loading"> <Loading color="#409eff" /> </el-icon> <div v-else> <template v-if="row._problems.length > 0"> <div v-for="(p, i) in row._problems" :key="p.guid"> <el-text>{{ i + 1 }}ã</el-text> <el-text>{{ p.problemname }}</el-text> </div> </template> <el-text v-else>/</el-text> </div> </template> </el-table-column> <!-- <el-table-column prop="subTaskTime" @@ -65,8 +100,15 @@ prop="evaluation.resultscorebef" label="å¾å" width="90" sortable="custom" /> --> <el-table-column prop="" label="çæµæ°æ®" width="81"> <template #default="{ row }"> <el-icon class="is-loading" v-if="row._loading"> <Loading color="#409eff" /> </el-icon> <el-text v-else>/</el-text> </template> </el-table-column> <!-- <el-table-column prop="evaluation.resultscorebef" label="ç¯ä¿¡ç " @@ -80,14 +122,23 @@ </el-table-column> --> <el-table-column prop="dname" label="åºå¿" width="90" /> <el-table-column prop="tname" label="è¡é" width="110" :filters="townFilters" :filter-method="filterHandler" /> <el-table-column prop="evaluation.scenseaddress" label="å°å" /> <el-table-column prop="tname" label="è¡é" width="110" /> <el-table-column prop="_contacts" label="è系人" width="70"> <template #default="{ row }"> <el-icon class="is-loading" v-if="row._loading2"> <Loading color="#409eff" /> </el-icon> <el-text v-else>{{ row._contacts }}</el-text> </template> </el-table-column> <el-table-column prop="_contactst" label="èç³»çµè¯" width="112"> <template #default="{ row }"> <el-icon class="is-loading" v-if="row._loading2"> <Loading color="#409eff" /> </el-icon> <el-text v-else>{{ row._contactst }}</el-text> </template> </el-table-column> <!-- <el-table-column prop="biArea" label="éä¸åº" width="110" /> <el-table-column prop="biManagementCompany" label="ç©ä¸" min-width="110"/> --> <!-- <el-table-column fixed="right" align="right" label="æä½" width="160"> @@ -107,10 +158,15 @@ */ import dayjs from 'dayjs'; import evaluateApi from '@/api/fysp/evaluateApi'; import problemApi from '@/api/fysp/problemApi'; import sceneApi from '@/api/fysp/sceneApi'; import { conversionFromTable } from "@/utils/excel"; import { envCreditCode } from '@/constants/index'; import { useTablePaste } from '@/composables/tablePaste'; import { useCloned } from '@vueuse/core'; import { useMessageBoxTip } from '@/composables/messageBox'; import * as XLSX from 'xlsx'; import FileSaver from 'file-saver'; export default { setup() { @@ -144,20 +200,7 @@ townFilters: [], // åå§æ°æ®ï¼ç¨äºæåºåæ¶å orginData: [], evaluationRule: undefined, evaluationSubRule: undefined, //çæµæ°æ®è§ååç§° ruleName: { score1: { id: undefined, name: 'çæµæ°æ®åºç°åæ¥å以䏿æè¶ æ ' }, score2: { id: undefined, name: 'çæµæ°æ®æåå¼è¶ åºåæåå¼20%ä»¥ä¸ææ°æ®ææ¾å¼å¸¸' } }, updateLoading: false dlLoading: false }; }, computed: { @@ -185,22 +228,20 @@ } else { return ``; } }, downloadDisabled() { if (this.tableData.length == 0) { return true; } else { let b = false; this.tableData.forEach((e) => { b = b || e._loading || e._loading2; }); return b; } } }, methods: { // _getParam() { // const { locations, scenetype, time } = this.formSearch; // return { // provincecode: locations.pCode, // provincename: locations.pName, // citycode: locations.cCode, // cityname: locations.cName, // districtcode: locations.dCode, // districtname: locations.dName, // starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'), // scensetypeid: scenetype.value // }; // }, editRow(row) { this.$router.push(`evalutationEdit/${row.subTaskId}`); }, @@ -212,78 +253,60 @@ }, onSearch(page, func) { this.$refs.tableRef.clearSort(); this.fetchEvaluationRule(this.area).then(() => { evaluateApi.fetchAutoEvaluation(this.area).then((res) => { if (res.data) { this.tableData = res.data .filter((d) => { return d.evaluation != null; // this.fetchEvaluationRule(this.area).then(() => { evaluateApi.fetchAutoEvaluation(this.area).then((res) => { if (res.data) { res.data.sort((a, b) => { const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0; const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0; return s1 - s2; }); this.tableData = res.data .filter((d) => { return ( d.evaluation != null && parseInt(d.evaluation.resultscorebef) < 90 ); }) .slice(0, 10); this.tableData.forEach((e) => { e._loading = true; problemApi .getProBySubtask(e.subTaskId) .then((res) => { e._problems = res; }) .slice(0, 10); this.tableData.sort((a, b) => { const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0; const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0; return s1 - s2; }); this.orginData = useCloned(this.tableData).cloned; this.getFilters(res.data); if (typeof func === 'function') { func({ data: this.tableData }); } } else { this.tableData = []; this.orginData = []; if (typeof func === 'function') { func({ data: this.tableData }); } } }); }); }, fetchEvaluationRule() { const param = { // èªå¨è¯ä¼°ç±»å taskTypeId: 99, ...this.area }; // è·åè¯ä¼°æ»è§å return evaluateApi.fetchEvaluationRule(param).then((res) => { if (res.data.length > 0) { this.evaluationRule = res.data[0]; // è·åå ·ä½åè§å return evaluateApi .getSubRules(this.evaluationRule.guid) .then((res) => { this.evaluationSubRule = res.data; // æ¥æ¾å¯å¯¼å ¥å¾åçè§åid for (const key in this.ruleName) { const value = this.ruleName[key]; const subrule = this.evaluationSubRule.find((v) => { return v.itemname == value.name; }); if (subrule) { value.id = subrule.guid; } } }); } }); }, .finally(() => { e._loading = false; }); getFilters(data) { const townList = []; data.forEach((e) => { if (townList.indexOf(e.tname) == -1) { townList.push(e.tname); e._loading2 = true; sceneApi .getSceneDetail(e.sceneId) .then((res) => { //åºæ¯ if (res.data.scense) { e._contacts = res.data.scense.contacts; e._contactst = res.data.scense.contactst; } }) .finally(() => { e._loading2 = false; }); }); // this.orginData = useCloned(this.tableData).cloned; if (typeof func === 'function') { func(); } } else { this.tableData = []; // this.orginData = []; if (typeof func === 'function') { func(); } } }); this.townFilters = townList.map((v) => { return { text: v, value: v }; }); // }); }, toCode(row, column) { if (row.evaluation) { @@ -304,54 +327,23 @@ const property = column['property']; return row[property] === value; }, sortScore(a, b) { const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0; const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0; return s1 - s2; }, handleSortChange({ column, prop, order }) { console.log(column, prop, order); if (order == null) { this.orginData.forEach((e, i) => { this.tableData[i] = e; }); } else if (prop == 'evaluation.resultscorebef') { this.tableData.sort((a, b) => { const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0; const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0; if (order == 'ascending') { return s1 - s2; } else if (order == 'descending') { return s2 - s1; } }); } else if (prop == 'sceneIndex') { this.tableData.sort((a, b) => { if (order == 'ascending') { if (a.sceneIndex === b.sceneIndex) { return a.subTaskTime > b.subTaskTime ? 1 : -1; } else { return a.sceneIndex - b.sceneIndex; } } else if (order == 'descending') { if (a.sceneIndex === b.sceneIndex) { return b.subTaskTime > a.subTaskTime ? 1 : -1; } else { return b.sceneIndex - a.sceneIndex; } } }); } else if (prop == 'subTaskTime') { this.tableData.sort((a, b) => { if (order == 'ascending') { return a[prop] > b[prop] ? 1 : -1; // return dayjs(a).isAfter(dayjs(b)) ? 1 : -1; } else if (order == 'descending') { return b[prop] > a[prop] ? 1 : -1; // return dayjs(b).isAfter(dayjs(a)) ? 1 : -1; } }); } download() { // const workbook = XLSX.utils.book_new(); // const worksheet = XLSX.utils.json_to_sheet(this.tableData); // XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1'); // const excelData = XLSX.write(workbook, { // bookType: 'xlsx', // type: 'array' // }); // const blob = new Blob([excelData], { // type: 'application/vnd.openxmlformats-officedocumnet.spreadsheetml.sheet' // }); const { locations, scenetype, time } = this.formSearch; const name = `${locations.dName}${dayjs(time).format( 'YYYYå¹´MMæ' )}èåæ§æ³æ¸ å.xlsx`; // FileSaver.saveAs(blob, name); conversionFromTable('fyTable', name) } }, mounted() { src/views/fysp/data-product/ProdSceneReport.vue
@@ -107,6 +107,7 @@ import { ref, computed } from 'vue'; import { $fysp } from '@/api/index'; import problemApi from '@/api/fysp/problemApi'; import taskApi from '@/api/fysp/taskApi'; import sceneApi from '@/api/fysp/sceneApi'; import deviceApi from '@/api/fysp/deviceApi'; @@ -317,7 +318,7 @@ function fetchProblems(s) { curProList.value = []; taskApi.getProBySubtask(s.data.stGuid).then((res) => { problemApi.getProBySubtask(s.data.stGuid).then((res) => { curProList.value = res; // çæå·¡æ¥æè¿°ææ¬