| | |
| | | let ip2_file = 'https://fyami.com.cn/'; |
| | | |
| | | if (debug) { |
| | | ip1 = 'http://192.168.0.138:9091/'; |
| | | ip1 = 'http://192.168.0.138:8080/'; |
| | | // ip1_file = 'http://192.168.0.138:8080/'; |
| | | // ip2 = 'http://192.168.0.138:8080/'; |
| | | // ip2_file = 'https://fyami.com.cn/'; |
| | |
| | | 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'] |
| | | ElCard: typeof import('element-plus/es')['ElCard'] |
| | | ElCascader: typeof import('element-plus/es')['ElCascader'] |
| | | ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
| | |
| | | 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'] |
| | |
| | | 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'] |
| | | ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | |
| | | ElSwitch: typeof import('element-plus/es')['ElSwitch'] |
| | | ElTable: typeof import('element-plus/es')['ElTable'] |
| | | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
| | | ElTabPane: typeof import('element-plus/es')['ElTabPane'] |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | 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'] |
| | | FormCol: typeof import('./components/layout/FormCol.vue')['default'] |
| | | FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default'] |
| | |
| | | <el-form :inline="true" :size="size"> |
| | | <slot name="options"></slot> |
| | | <el-form-item> |
| | | <el-button icon="Search" type="primary" :loading="loading" @click="search">{{ btnText }}</el-button> |
| | | <el-button |
| | | icon="Search" |
| | | type="primary" |
| | | :loading="loading" |
| | | @click="search" |
| | | @kekeyup.enter="search" |
| | | >{{ btnText }}</el-button |
| | | > |
| | | <slot name="buttons"></slot> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <slot name="options-expand2"></slot> |
| | | </div> |
| | | <el-table |
| | | ref="tableRef" |
| | | :data="tableData" |
| | | v-loading="loading" |
| | | table-layout="fixed" |
| | | :row-class-name="tableRowClassName" |
| | | :height="tableHeight" |
| | | :size="fontSize" |
| | | @cell-click="cellClick" |
| | | :cell-class-name="cellClassName" |
| | | @paste="handlePaste" |
| | | @sort-change="handleSortChange" |
| | | border |
| | | > |
| | | <slot name="table-column" :size="fontSize"></slot> |
| | |
| | | export default { |
| | | props: { |
| | | rowClassName: undefined, |
| | | cellClassName: Function || String, |
| | | pagination: { |
| | | type: Boolean, |
| | | default: true |
| | |
| | | fontSize: 'default' |
| | | }; |
| | | }, |
| | | emits: ['search'], |
| | | emits: ['search', 'cellClick', 'tablePaste'], |
| | | watch: { |
| | | currentPage(nValue, oValue) { |
| | | if (nValue != oValue) { |
| | |
| | | this.tableData = res.data; |
| | | this.total = res.total ? res.total : 0; |
| | | this.loading = false; |
| | | this.doLayout(); |
| | | } |
| | | ); |
| | | }, |
| | |
| | | } else { |
| | | return row.extension1 != '0' ? 'online-row' : 'offline-row'; |
| | | } |
| | | }, |
| | | cellClick(row, column, cell, event) { |
| | | this.$emit('cellClick', row, column, cell, event); |
| | | }, |
| | | handlePaste(event) { |
| | | this.$emit('tablePaste', event); |
| | | }, |
| | | doLayout(){ |
| | | this.$refs.tableRef.doLayout(); |
| | | }, |
| | | handleSortChange({column, prop, order }){ |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref, watch } from 'vue'; |
| | | import { useEvent } from './event'; |
| | | |
| | | /** |
| | | * è¡¨æ ¼å¤è¡å¤åç²è´´äºä»¶ |
| | | * @param {object} obj éè¦ç²è´´ç屿§ä»¥å对åºçåç´¢å¼å¼ï¼å
¶ä¸å段åä¸ºå±æ§åï¼å¼ä¸ºç´¢å¼å¼ |
| | | * @returns |
| | | */ |
| | | export function useTablePaste(obj) { |
| | | const { invokeEvent, addEvent: addRefreshEvent } = useEvent(); |
| | | |
| | | const rowIndex = ref(0); |
| | | const columnIndex = ref(0); |
| | | const tableData = ref([]); |
| | | |
| | | function setTableData(data) { |
| | | tableData.value = data; |
| | | } |
| | | |
| | | function cellClick(row, column, cell, event) { |
| | | rowIndex.value = row.index; |
| | | columnIndex.value = column.index; |
| | | } |
| | | function cellClassName({ row, column, rowIndex, columnIndex }) { |
| | | row.index = rowIndex; |
| | | column.index = columnIndex; |
| | | } |
| | | function handlePaste(event) { |
| | | // 黿¢é»è®¤çç²è´´è¡ä¸ºåäºä»¶å泡ã |
| | | event.preventDefault(); |
| | | event.stopPropagation(); |
| | | |
| | | // è·ååªè´´æ¿æ°æ®å¹¶æåçº¯ææ¬å
容ã |
| | | const clipboardData = event.clipboardData; |
| | | const text = clipboardData.getData('text/plain'); |
| | | // å°ææ¬å
容æè¡åå¶è¡¨ç¬¦åå²ï¼è½¬æ¢ä¸ºäºç»´æ°ç» |
| | | let pastedText = text.split('\n').map((row) => { |
| | | return row.split('\t').map((ele) => { |
| | | return parseFloat(ele); |
| | | }); |
| | | }); |
| | | // è¡¨æ ¼å¤è¡å¤åç²è´´äºä»¶ã |
| | | // let obj = { |
| | | // score1: null, |
| | | // score2: null |
| | | // }; |
| | | // éåå¤çæ¯ä¸è¡æ°æ®ï¼æ ¹æ®è¡ç´¢å¼ååç´¢å¼å°æ°æ®å¡«å
å°è¡¨æ ¼ä¸ã |
| | | pastedText.forEach((ele1, index) => { |
| | | if (rowIndex.value + index <= tableData.value.length - 1) { |
| | | // let item = JSON.parse(JSON.stringify(tableData[rowIndex + index])); |
| | | let item = tableData.value[rowIndex.value + index]; |
| | | let num = 0; |
| | | // 使ç¨å¾ªç¯åæ¡ä»¶å¤æï¼å°å¤çåçæ°æ®æåç´¢å¼å¡«å
å°å
éçè¡å¯¹è±¡ä¸ |
| | | for (let key in obj) { |
| | | const value = obj[key]; |
| | | if (num < ele1.length && value >= columnIndex.value) { |
| | | item[key] = ele1[num] || ele1[num] == 0 ? ele1[num] : null; |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | invokeEvent(); |
| | | } |
| | | |
| | | return { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData }; |
| | | } |
| | |
| | | <template> |
| | | <FYTable @search="onSearch" :pagination="false" ref="tableRef"> |
| | | <FYTable |
| | | @search="onSearch" |
| | | :pagination="false" |
| | | ref="tableRef" |
| | | @cell-click="cellClick" |
| | | :cell-class-name="cellClassName" |
| | | @table-paste="handlePaste" |
| | | > |
| | | <template #options> |
| | | <!-- åºå¿ --> |
| | | <FYOptionLocation |
| | |
| | | <el-table-column prop="evaluation.scenseaddress" label="å°å" /> |
| | | <!-- <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"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.score1" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" align="right" label="çæµæ°æ®è¶
åºæåå¼" width="160"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.score2" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" align="right" label="æä½" width="160"> |
| | | <!-- <template #header> |
| | | <el-button icon="Download" size="default" type="success" @click="exportExcel" |
| | |
| | | import evaluateApi from '@/api/fysp/evaluateApi'; |
| | | import { envCreditCode } from '@/constants/index'; |
| | | import CompReport from './components/CompReport.vue'; |
| | | import { useTablePaste } from '@/composables/tablePaste'; |
| | | |
| | | export default { |
| | | name: 'ResultManage', |
| | | setup() { |
| | | const { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData } = |
| | | useTablePaste({ |
| | | score1: 8, |
| | | score2: 9 |
| | | }); |
| | | return { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData }; |
| | | }, |
| | | components: { CompReport }, |
| | | data() { |
| | | return { |
| | |
| | | onSearch(page, func) { |
| | | const area = this._getParam(); |
| | | evaluateApi.fetchAutoEvaluation(area).then((res) => { |
| | | if (typeof func === 'function') { |
| | | func({ data: res.data }); |
| | | } |
| | | if (res.data) { |
| | | this.tableData = res.data; |
| | | this.getFilters(res.data); |
| | | if (typeof func === 'function') { |
| | | func({ data: this.tableData }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0; |
| | | const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0; |
| | | return s1 - s2; |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.addRefreshEvent(this.$refs.tableRef.doLayout); |
| | | } |
| | | }; |
| | | </script> |