1. 新增自动评估记录的获取和展示;
2. 新增评估记录排序功能;
3. 新增评估任务界面;
| | |
| | | { |
| | | "$schema": "https://json.schemastore.org/prettierrc", |
| | | "semi": false, |
| | | "semi": true, |
| | | "tabWidth": 2, |
| | | "singleQuote": true, |
| | | "printWidth": 100, |
| | |
| | | "@vueuse/core": "^9.7.0", |
| | | "axios": "^1.2.1", |
| | | "dayjs": "^1.11.10", |
| | | "element-plus": "^2.2.26", |
| | | "element-plus": "^2.4.3", |
| | | "pinia": "^2.0.26", |
| | | "vue": "^3.2.45", |
| | | "vue-router": "^4.1.6" |
| | |
| | | } |
| | | }, |
| | | "node_modules/@element-plus/icons-vue": { |
| | | "version": "2.0.10", |
| | | "license": "MIT", |
| | | "version": "2.3.1", |
| | | "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", |
| | | "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", |
| | | "peerDependencies": { |
| | | "vue": "^3.2.0" |
| | | } |
| | |
| | | "license": "ISC" |
| | | }, |
| | | "node_modules/element-plus": { |
| | | "version": "2.2.26", |
| | | "license": "MIT", |
| | | "version": "2.4.3", |
| | | "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz", |
| | | "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==", |
| | | "dependencies": { |
| | | "@ctrl/tinycolor": "^3.4.1", |
| | | "@element-plus/icons-vue": "^2.0.6", |
| | | "@element-plus/icons-vue": "^2.3.1", |
| | | "@floating-ui/dom": "^1.0.1", |
| | | "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", |
| | | "@types/lodash": "^4.14.182", |
| | |
| | | } |
| | | }, |
| | | "@element-plus/icons-vue": { |
| | | "version": "2.0.10", |
| | | "version": "2.3.1", |
| | | "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", |
| | | "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", |
| | | "requires": {} |
| | | }, |
| | | "@eslint-community/eslint-utils": { |
| | |
| | | "dev": true |
| | | }, |
| | | "element-plus": { |
| | | "version": "2.2.26", |
| | | "version": "2.4.3", |
| | | "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz", |
| | | "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==", |
| | | "requires": { |
| | | "@ctrl/tinycolor": "^3.4.1", |
| | | "@element-plus/icons-vue": "^2.0.6", |
| | | "@element-plus/icons-vue": "^2.3.1", |
| | | "@floating-ui/dom": "^1.0.1", |
| | | "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", |
| | | "@types/lodash": "^4.14.182", |
| | |
| | | "@vueuse/core": "^9.7.0", |
| | | "axios": "^1.2.1", |
| | | "dayjs": "^1.11.10", |
| | | "element-plus": "^2.2.26", |
| | | "element-plus": "^2.4.3", |
| | | "pinia": "^2.0.26", |
| | | "vue": "^3.2.45", |
| | | "vue-router": "^4.1.6" |
| | |
| | | BaseContentLayout: typeof import('./components/core/BaseContentLayout.vue')['default'] |
| | | BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default'] |
| | | Content: typeof import('./components/core/Content.vue')['default'] |
| | | copy: typeof import('./components/search-option/FYOptionScene copy.vue')['default'] |
| | | ElAside: typeof import('element-plus/es')['ElAside'] |
| | | ElAvatar: typeof import('element-plus/es')['ElAvatar'] |
| | | ElBacktop: typeof import('element-plus/es')['ElBacktop'] |
| | |
| | | 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'] |
| | |
| | | FYTable: typeof import('./components/table/FYTable.vue')['default'] |
| | | Header: typeof import('./components/core/Header.vue')['default'] |
| | | MenuItems: typeof import('./components/core/MenuItems.vue')['default'] |
| | | ProblemCard: typeof import('./components/ProblemCard.vue')['default'] |
| | | RouterLink: typeof import('vue-router')['RouterLink'] |
| | | RouterView: typeof import('vue-router')['RouterView'] |
| | | SearchBar: typeof import('./components/SearchBar.vue')['default'] |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '../../constants/index' |
| | | import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '@/constants/index' |
| | | |
| | | export default { |
| | | name: 'CoreSiderMenu', |
| | |
| | | label-width="150px" |
| | | > |
| | | <slot name="form-item" :formObj="formObj"></slot> |
| | | <el-form-item> |
| | | <el-button |
| | | :disabled="!edit" |
| | | type="primary" |
| | | @click="onSubmit" |
| | | :loading="loading" |
| | | <el-form-item v-if="showButtons"> |
| | | <el-button :disabled="!edit" type="primary" @click="onSubmit" :loading="loading" |
| | | >æäº¤</el-button |
| | | > |
| | | <el-button :disabled="!edit" @click="onReset">éç½®</el-button> |
| | |
| | | formInfo: Object, |
| | | //è¡¨åæ£éªè§å |
| | | rules: Object, |
| | | showButtons: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | //åæ¶æé®æ¯å¦å¯ç¨ |
| | | enableCancelBtn: Boolean, |
| | | //触åéç½® |
| | | reset: Boolean, |
| | | //éç¥ç¼è¾ç¶æ |
| | | isEdit: Boolean, |
| | | isEdit: Boolean |
| | | }); |
| | | |
| | | //触å彿°ï¼æäº¤ååæ¶ |
| | |
| | | //表åæä½å½æ° |
| | | const { formObj, formRef, edit, onSubmit, onCancel, onReset } = useFormConfirm({ |
| | | submit: { |
| | | do: submit, |
| | | do: submit |
| | | }, |
| | | cancel: { |
| | | do: cancel, |
| | | }, |
| | | do: cancel |
| | | } |
| | | }); |
| | | |
| | | //å è½½ç¶æ |
| | |
| | | table-layout="fixed" |
| | | :row-class-name="tableRowClassName" |
| | | :height="tableHeight" |
| | | border |
| | | > |
| | | <slot name="table-column"></slot> |
| | | </el-table> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // ç¯ä¿¡ç è½¬æ¢ |
| | | |
| | | function envCreditCode(score) { |
| | | const s = parseInt(score) |
| | | if (s <= 59) { |
| | | return { |
| | | value: 2, |
| | | name: '红ç ', |
| | | color: '#db2828' |
| | | }; |
| | | } else if (s <= 89) { |
| | | return { |
| | | value: 1, |
| | | name: 'é»ç ', |
| | | color: '#f7a62c' |
| | | }; |
| | | } else { |
| | | return { |
| | | value: 0, |
| | | name: '绿ç ', |
| | | color: '#21ba45' |
| | | }; |
| | | } |
| | | } |
| | | |
| | | export { envCreditCode }; |
| | |
| | | export { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from './menu' |
| | | export { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from './menu'; |
| | | export { envCreditCode } from './envCreditCode'; |
| | |
| | | { |
| | | path: '/fysp/evaluation/datasource', |
| | | icon: 'MessageBox', |
| | | name: 'è¯ä¼°æ°æ®æº', |
| | | name: 'è¯ä¼°ä»»å¡', |
| | | }, |
| | | { |
| | | path: '/fysp/evaluation/resultManage', |
| | | icon: 'Tickets', |
| | | name: 'è¯ä¼°ç®¡ç', |
| | | name: 'è¯ä¼°è®°å½', |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | // å è½½ç¶æçé»è¾ç®¡ç |
| | | |
| | | import { defineStore } from 'pinia' |
| | | import { defineStore } from 'pinia'; |
| | | |
| | | export const useLoadingStore = defineStore('loading', { |
| | | state: () => { |
| | | return { |
| | | loadingStatus: [] |
| | | } |
| | | }; |
| | | }, |
| | | actions: { |
| | | pushLoading(func) { |
| | | const timeout = setTimeout(func, 3000); |
| | | this.loadingStatus.push({ t: timeout, f: func }); |
| | | }, |
| | | clearLoading() { |
| | | this.loadingStatus.forEach(l => { |
| | | if (typeof l === 'function') { |
| | | l() |
| | | } |
| | | }); |
| | | if (this.loadingStatus.length > 0) { |
| | | this.loadingStatus = [] |
| | | this.loadingStatus.forEach((obj) => { |
| | | clearTimeout(obj.t) |
| | | obj.f() |
| | | }); |
| | | this.loadingStatus = []; |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | |
| | | }, |
| | | itemEdit(scope) { |
| | | scope.row.loading1 = true; |
| | | this.loadingStore.loadingStatus.push(() => (scope.row.loading1 = false)); |
| | | this.loadingStore.pushLoading(() => (scope.row.loading1 = false)); |
| | | this.$router.push(`sceneEdit/${scope.row.guid}`); |
| | | }, |
| | | itemActive(scope) { |
| | |
| | | <template> |
| | | <div>DataSource</div> |
| | | <el-row :gutter="16"> |
| | | <el-col :span="16"> |
| | | <CompPreCheck></CompPreCheck> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="radius"></div> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import CompPreCheck from "./components/CompPreCheck.vue"; |
| | | export default { |
| | | name: 'DataSource', |
| | | components: { CompPreCheck }, |
| | | data() { |
| | | return { |
| | | |
| | | } |
| | | return {}; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .radius { |
| | | height: 80vh; |
| | | border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-border-radius-base); |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <!-- <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck> --> |
| | | |
| | | <FYTable @search="onSearch" :pagination="false"> |
| | | <FYTable @search="onSearch" :pagination="false" ref="tableRef"> |
| | | <template #options> |
| | | <!-- åºå¿ --> |
| | | <FYOptionLocation |
| | |
| | | </template> |
| | | |
| | | <template #table-column> |
| | | <el-table-column |
| | | type="index" |
| | | fixed="left" |
| | | prop="sceneName" |
| | | label="åç§°" |
| | | width="400" |
| | | > |
| | | <template #default="{row}"> |
| | | <el-table-column type="index" fixed="left" prop="sceneName" label="åç§°" width="300"> |
| | | <template #default="{ row }"> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="row.sceneName" |
| | |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="subTaskTime" |
| | | label="å·¡æ¥æ¥æ" |
| | | width="110" |
| | | sortable |
| | | :formatter="timeFormat" |
| | | /> |
| | | <el-table-column |
| | | prop="evaluation.resultscorebef" |
| | | label="å¾å" |
| | | width="90" |
| | | sortable |
| | | :sort-method="sortScore" |
| | | /> |
| | | <el-table-column prop="evaluation.resultscorebef" label="ç¯ä¿¡ç " width="100"> |
| | | <template #default="{ row }"> |
| | | <span :style="`color: ${toCode(row).color};`">{{ toCode(row).name }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="dname" label="åºå¿" width="90" /> |
| | | <el-table-column prop="tname" label="è¡é" width="110" /> |
| | | <el-table-column |
| | | prop="tname" |
| | | label="è¡é" |
| | | width="110" |
| | | :filters="townFilters" |
| | | :filter-method="filterHandler" |
| | | /> |
| | | <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 prop="evaluation.resultscorebef" label="å¾å" width="110" /> |
| | | <el-table-column fixed="right" align="right" label="æä½" width="160"> |
| | | <template #header> |
| | | <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true" |
| | | >èªå¨è¯ä¼°</el-button |
| | | > |
| | | </template> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" size="small" @click="editRow(row)">æ¥ç</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </FYTable> |
| | | </template> |
| | | |
| | | <script> |
| | | import CompPreCheck from './components/CompPreCheck.vue' |
| | | import evaluateApi from '@/api/fysp/evaluateApi' |
| | | import dayjs from 'dayjs' |
| | | import CompQuickSet from './components/CompQuickSet.vue' |
| | | import dayjs from 'dayjs'; |
| | | import evaluateApi from '@/api/fysp/evaluateApi'; |
| | | import { envCreditCode } from '@/constants/index'; |
| | | import CompQuickSet from './components/CompQuickSet.vue'; |
| | | |
| | | export default { |
| | | name: 'ResultManage', |
| | | components: { CompPreCheck, CompQuickSet }, |
| | | components: { CompQuickSet }, |
| | | data() { |
| | | return { |
| | | formSearch: { |
| | | locations: {}, |
| | | scenetype: {}, |
| | | time: dayjs().add(-1, 'M').date(1).toDate() |
| | | } |
| | | } |
| | | }, |
| | | townFilters: [] |
| | | }; |
| | | }, |
| | | methods: { |
| | | setOptions(param) { |
| | | this.formSearch.locations = param.locations |
| | | this.formSearch.scenetype = param.scenetype |
| | | this.formSearch.locations = param.locations; |
| | | this.formSearch.scenetype = param.scenetype; |
| | | this.$refs.tableRef.onSearch() |
| | | }, |
| | | onSearch(page, func) { |
| | | const { locations, scenetype, time } = this.formSearch |
| | | const { locations, scenetype, time } = this.formSearch; |
| | | const area = { |
| | | provincecode: locations.pCode, |
| | | provincename: locations.pName, |
| | |
| | | districtname: locations.dName, |
| | | starttime: dayjs(time).format('YYYY-MM-DD'), |
| | | scensetypeid: scenetype.value |
| | | } |
| | | }; |
| | | evaluateApi.fetchAutoEvaluation(area).then((res) => { |
| | | if (res) { |
| | | func({ |
| | | data: res.data |
| | | }) |
| | | if (typeof func === 'function') { |
| | | func({ data: res.data }); |
| | | } |
| | | }) |
| | | if (res.data) { |
| | | this.getFilters(res.data); |
| | | } |
| | | }); |
| | | }, |
| | | getFilters(data) { |
| | | const townList = []; |
| | | data.forEach((e) => { |
| | | if (townList.indexOf(e.tname) == -1) { |
| | | townList.push(e.tname); |
| | | } |
| | | }); |
| | | this.townFilters = townList.map((v) => { |
| | | return { text: v, value: v }; |
| | | }); |
| | | }, |
| | | toCode(row, column) { |
| | | if (row.evaluation) { |
| | | return envCreditCode(row.evaluation.resultscorebef); |
| | | } else { |
| | | return ''; |
| | | } |
| | | }, |
| | | timeFormat(row, column) { |
| | | const time = row.subTaskTime; |
| | | if (time) { |
| | | return dayjs(time).format('MM-DD'); |
| | | } else { |
| | | return ''; |
| | | } |
| | | }, |
| | | filterHandler(value, row, column) { |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .a { |
| | | color: #f7a62c; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <FYSearchBar @search="preCheck"> |
| | | <template #options> |
| | | <!-- åºå¿ --> |
| | | <FYOptionLocation |
| | | :allOption="false" |
| | | :level="3" |
| | | :checkStrictly="false" |
| | | v-model:value="formSearch.locations" |
| | | ></FYOptionLocation> |
| | | <!-- åºæ¯ç±»å --> |
| | | <FYOptionScene |
| | | :allOption="false" |
| | | :type="2" |
| | | v-model:value="formSearch.scenetype" |
| | | ></FYOptionScene> |
| | | <!-- æ¶é´ --> |
| | | <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime> |
| | | <el-steps :active="stepIndex" finish-status="success" style="" align-center> |
| | | <el-step title="è¯ä¼°èå´" /> |
| | | <el-step title="æ°æ®æºæ£æ¥" /> |
| | | <el-step title="è±å
æ¡ç®" /> |
| | | <el-step title="èªå¨è¯ä¼°" /> |
| | | </el-steps> |
| | | |
| | | <el-card v-if="stepIndex == 0" shadow="never"> |
| | | <template #header> |
| | | <div><el-text tag="b" size="large">éæ©è¯ä¼°èå´</el-text></div> |
| | | <el-text size="small" type="info">å
æ¬åºå¿ãåºæ¯ç±»å以åæä»½</el-text> |
| | | </template> |
| | | </FYSearchBar> |
| | | <el-row> |
| | | <span>å¿«æ·éæ©</span> |
| | | <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{ |
| | | v.name |
| | | }}</el-button> |
| | | </el-row> |
| | | <FYForm :form-info="evaConditon" :rules="evaConditionRules" :showButtons="false"> |
| | | <template #form-item="{ formObj }"> |
| | | <!-- åºå¿ --> |
| | | <FYOptionLocation |
| | | :allOption="false" |
| | | :level="3" |
| | | :checkStrictly="false" |
| | | v-model:value="formObj.locations" |
| | | ></FYOptionLocation> |
| | | <!-- åºæ¯ç±»å --> |
| | | <FYOptionScene |
| | | :allOption="false" |
| | | :type="2" |
| | | v-model:value="formObj.scenetype" |
| | | ></FYOptionScene> |
| | | <!-- æ¶é´ --> |
| | | <FYOptionTime |
| | | :initValue="true" |
| | | type="month" |
| | | v-model:value="formObj.time" |
| | | ></FYOptionTime> |
| | | </template> |
| | | </FYForm> |
| | | <template #footer> |
| | | <el-row justify="space-around"> |
| | | <el-button type="primary" size="default">ä¸ä¸æ¥</el-button> |
| | | </el-row> |
| | | </template> |
| | | </el-card> |
| | | <el-card v-if="stepIndex == 1" shadow="never"> Never2 </el-card> |
| | | <el-card v-if="stepIndex == 2" shadow="never"> Never3 </el-card> |
| | | <el-card v-if="stepIndex == 3" shadow="never"> Never4 </el-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs' |
| | | import dayjs from 'dayjs'; |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼°æ¡ä»¶åè§æ§æ£æ¥ |
| | | */ |
| | | export default { |
| | | name: 'CompPreCheck', |
| | | props: { |
| | | quickSetting: { |
| | | type: Array, |
| | | default: () => { |
| | | return [ |
| | | { |
| | | name: 'éå®å·¥å°', |
| | | locations: { |
| | | pCode: '31', |
| | | pName: '䏿µ·å¸', |
| | | cCode: '3100', |
| | | cName: '䏿µ·å¸', |
| | | dCode: '310106', |
| | | dName: 'éå®åº' |
| | | }, |
| | | scenetype: { label: 'å·¥å°', value: '1' } |
| | | }, |
| | | { |
| | | name: '徿±é¤é¥®', |
| | | locations: { |
| | | pCode: '31', |
| | | pName: '䏿µ·å¸', |
| | | cCode: '3100', |
| | | cName: '䏿µ·å¸', |
| | | dCode: '310104', |
| | | dName: '徿±åº' |
| | | }, |
| | | scenetype: { label: 'é¤é¥®', value: '5' } |
| | | }, |
| | | { |
| | | name: 'é山工å°', |
| | | locations: { |
| | | pCode: '31', |
| | | pName: '䏿µ·å¸', |
| | | cCode: '3100', |
| | | cName: '䏿µ·å¸', |
| | | dCode: '310116', |
| | | dName: 'éå±±åº' |
| | | }, |
| | | scenetype: { label: 'å·¥å°', value: '1' } |
| | | }, |
| | | { |
| | | name: 'éå±±ç 头', |
| | | locations: { |
| | | pCode: '31', |
| | | pName: '䏿µ·å¸', |
| | | cCode: '3100', |
| | | cName: '䏿µ·å¸', |
| | | dCode: '310116', |
| | | dName: 'éå±±åº' |
| | | }, |
| | | scenetype: { label: 'ç 头', value: '2' } |
| | | }, |
| | | { |
| | | name: 'éå±±æ
æç«', |
| | | locations: { |
| | | pCode: '31', |
| | | pName: '䏿µ·å¸', |
| | | cCode: '3100', |
| | | cName: '䏿µ·å¸', |
| | | dCode: '310116', |
| | | dName: 'éå±±åº' |
| | | }, |
| | | scenetype: { label: 'æ
æç«', value: '3' } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | props: {}, |
| | | emits: ['preCheck'], |
| | | data() { |
| | | return { |
| | | formSearch: { |
| | | locations: {}, |
| | | scenetype: {}, |
| | | time: dayjs().add(-1, 'M').date(1).toDate() |
| | | // æä½æ¥éª¤ä¸æ |
| | | stepIndex: 0, |
| | | // è¯ä¼°ä»»å¡èå´ |
| | | evaConditon: {}, |
| | | evaConditionRules: { |
| | | acountname: [ |
| | | { |
| | | required: true, |
| | | message: 'è´¦æ·åä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | /** |
| | |
| | | * æ£æ¥æéèå´å
å项è¯ä¼°æ°æ®æºæ¯å¦å®æ´ |
| | | */ |
| | | preCheck() { |
| | | const param = { |
| | | locations: this.formSearch.locations, |
| | | scenetype: this.formSearch.scenetype, |
| | | time: dayjs(this.formSearch.time).format('YYYY-MM-DD') |
| | | } |
| | | this.$emit('preCheck', param) |
| | | }, |
| | | |
| | | /** |
| | | * å¿«é设置æ¡ä»¶ |
| | | */ |
| | | quickSet(set) { |
| | | this.formSearch.locations = set.locations |
| | | this.formSearch.scenetype = set.scenetype |
| | | |
| | | // this.preCheck() |
| | | // this.$emit('preCheck', param) |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="userInfo.usertype" label="ç¨æ·ç±»å" width="90" /> |
| | | <el-table-column fixed="right" align="right" label="æä½" width="140"> |
| | | <el-table-column fixed="right" align="right" label="æä½" width="160"> |
| | | <template #header> |
| | | <el-button |
| | | icon="DocumentAdd" |
| | |
| | | @click="editRow(scope)" |
| | | >æ¥ç</el-button |
| | | > |
| | | <!-- <el-button |
| | | <el-button |
| | | :loading="scope.row.loading2" |
| | | :type="scope.row.extension1 != '0' ? 'danger' : 'primary'" |
| | | :type="scope.row.userInfo.isenable != '0' ? 'danger' : 'primary'" |
| | | size="small" |
| | | @click="itemActive(scope)" |
| | | >{{ scope.row.extension1 != '0' ? 'ä¸çº¿' : 'ä¸çº¿' }}</el-button |
| | | > --> |
| | | >{{ scope.row.userInfo.isenable != '0' ? 'ä¸çº¿' : 'ä¸çº¿' }}</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | }, |
| | | editRow(scope) { |
| | | scope.row.loading1 = true; |
| | | this.loadingStore.loadingStatus.push(() => (scope.row.loading1 = false)); |
| | | this.$router.push(`userEdit/${scope.row.biGuid}`); |
| | | this.loadingStore.pushLoading(() => (scope.row.loading1 = false)); |
| | | this.$router.push(`userEdit/${scope.row.userInfo.guid}`); |
| | | }, |
| | | itemActive(scope) { |
| | | const rb = {}; |
| | | rb.guid = scope.row.guid; |
| | | rb.extension1 = scope.row.extension1 != '0' ? '0' : '1'; |
| | | const msg = scope.row.extension1 != '0' ? 'ä¸çº¿' : 'ä¸çº¿'; |
| | | const param = { |
| | | guid: scope.row.userInfo.guid, |
| | | isenable: !scope.row.userInfo.isenable |
| | | } |
| | | const msg = scope.row.userInfo.isenable ? 'ä¸çº¿' : 'ä¸çº¿'; |
| | | useMessageBoxTip({ |
| | | confirmMsg: `确认${msg}è¯¥åºæ¯ï¼`, |
| | | confirmTitle: msg, |
| | | onConfirm: () => { |
| | | scope.row.loading2 = true; |
| | | return userApi |
| | | .updateScene(rb) |
| | | .updateUserInfo(param) |
| | | .then((res) => { |
| | | if (res == 1) { |
| | | scope.row.extension1 = rb.extension1; |
| | | if (res.success) { |
| | | scope.row.userInfo.isenable = param.isenable; |
| | | } |
| | | }) |
| | | .finally(() => { |
| | |
| | | </el-col> |
| | | <el-col :span="6" v-if="!create"> |
| | | <el-row justify="end"> |
| | | <el-button type="danger" @click="onResetPw" :loading="pwLoading" |
| | | >éç½®å¯ç </el-button |
| | | > |
| | | <el-button type="danger" @click="onResetPw" :loading="pwLoading">éç½®å¯ç </el-button> |
| | | </el-row> |
| | | </el-col> |
| | | </el-form-item> |
| | |
| | | </el-form-item> --> |
| | | <el-form-item label="æ¯å¦å¯ç¨" prop="isenable"> |
| | | <el-switch v-model="formObj.isenable" /> |
| | | <span style="margin-left: 16px">{{ |
| | | formObj.isenable ? 'å¯ç¨' : 'ä¸å¯ç¨' |
| | | }}</span> |
| | | <span style="margin-left: 16px">{{ formObj.isenable ? 'å¯ç¨' : 'ä¸å¯ç¨' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥å·" prop="workno"> |
| | | <el-input clearable v-model="formObj.workno" placeholder="å·¥å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ææº" prop="telephone"> |
| | | <el-input |
| | | clearable |
| | | type="tel" |
| | | v-model="formObj.telephone" |
| | | placeholder="ææº" |
| | | /> |
| | | <el-input clearable type="tel" v-model="formObj.telephone" placeholder="ææº" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç/å¸/åº/é" prop="_locations"> |
| | | <el-cascader |
| | |
| | | import { getSceneName } from '@/enum/scene'; |
| | | import { enumLocation } from '@/enum/location'; |
| | | import userApi from '@/api/fytz/userApi'; |
| | | import { useMessageBoxTip } from '@/composables/messageBox'; |
| | | |
| | | const props = defineProps({ |
| | | //åºæ¬ä¿¡æ¯ |
| | |
| | | isEdit: Boolean, |
| | | create: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: false |
| | | }, |
| | | active: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | default: false |
| | | } |
| | | }); |
| | | |
| | | const emit = defineEmits(['onSubmit', 'onCancel', 'update:isEdit']); |
| | | |
| | | const _formInfo = ref(); |
| | | const _formObject = { value: {} }; |
| | | const _edit = ref(false); |
| | | const locations = enumLocation(false); |
| | | const locationsProps = reactive({ |
| | | checkStrictly: true, |
| | | checkStrictly: true |
| | | }); |
| | | const rules = reactive({ |
| | | acountname: [ |
| | | { |
| | | required: true, |
| | | message: 'è´¦æ·åä¸è½ä¸ºç©º', |
| | | trigger: 'blur', |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | realname: [ |
| | | { |
| | | required: true, |
| | | message: 'ç¨æ·æµç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur', |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | // password: [ |
| | | // { |
| | |
| | | { |
| | | required: true, |
| | | message: 'ç¨æ·ç±»åä¸è½ä¸ºç©º', |
| | | trigger: 'change', |
| | | }, |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | _locations: [ |
| | | { |
| | | required: props.create, |
| | | message: 'ç/å¸/åº/éä¸è½ä¸ºç©º', |
| | | trigger: 'change', |
| | | }, |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | _scenetype: [ |
| | | { |
| | | required: true, |
| | | message: 'åºæ¯ç±»åä¸è½ä¸ºç©º', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | trigger: 'change' |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | // ç¨æ·åºæ¬ä¿¡æ¯æ ¼å¼å |
| | | function parseUserInfo(s) { |
| | | s._usertype = { |
| | | label: s.usertype, |
| | | value: s.usertypeid + '', |
| | | value: s.usertypeid + '' |
| | | }; |
| | | |
| | | s._scenetype = getSceneName(s.extension2, 1); |
| | |
| | | return s; |
| | | } |
| | | |
| | | function parseUserInfoReverse(formObj) { |
| | | // ç¨æ·ç±»åä¿¡æ¯å¡«å
|
| | | const b = formObj.value._usertype; |
| | | formObj.value.usertypeid = b.value; |
| | | formObj.value.usertype = b.label; |
| | | |
| | | // åºæ¯ç±»åä¿¡æ¯å¡«å
|
| | | const c = formObj.value._scenetype; |
| | | formObj.value.extension2 = c.value; |
| | | |
| | | return formObj; |
| | | } |
| | | |
| | | function createUser(formObj, func) { |
| | | return userApi |
| | | .createUser(formObj.value) |
| | |
| | | emit('onSubmit', formObj); |
| | | }) |
| | | .finally(() => { |
| | | _formObject.value = formObj.value; |
| | | func(); |
| | | }); |
| | | } |
| | |
| | | emit('onSubmit', formObj); |
| | | }) |
| | | .finally(() => { |
| | | func(); |
| | | _formObject.value = formObj.value; |
| | | if (func) func(); |
| | | }); |
| | | } |
| | | |
| | | function submit(formObj, func) { |
| | | // è¡æ¿åºåä¿¡æ¯å¡«å
|
| | | const a = formObj.value._locations; |
| | | if (a[0]) { |
| | | formObj.value.provincecode = a[0][0]; |
| | | formObj.value.provincename = a[0][1]; |
| | | } |
| | | if (a[1]) { |
| | | formObj.value.citycode = a[1][0]; |
| | | formObj.value.cityname = a[1][1]; |
| | | } |
| | | if (a[2]) { |
| | | formObj.value.districtcode = a[2][0]; |
| | | formObj.value.extension1 = a[2][1]; |
| | | } |
| | | if (a[3]) { |
| | | formObj.value.towncode = a[3][0]; |
| | | formObj.value.townname = a[3][1]; |
| | | } |
| | | // const a = formObj.value._locations; |
| | | // if (a[0]) { |
| | | // formObj.value.provincecode = a[0][0]; |
| | | // formObj.value.provincename = a[0][1]; |
| | | // } |
| | | // if (a[1]) { |
| | | // formObj.value.citycode = a[1][0]; |
| | | // formObj.value.cityname = a[1][1]; |
| | | // } |
| | | // if (a[2]) { |
| | | // formObj.value.districtcode = a[2][0]; |
| | | // formObj.value.extension1 = a[2][1]; |
| | | // } |
| | | // if (a[3]) { |
| | | // formObj.value.towncode = a[3][0]; |
| | | // formObj.value.townname = a[3][1]; |
| | | // } |
| | | |
| | | // ç¨æ·ç±»åä¿¡æ¯å¡«å
|
| | | const b = formObj.value._usertype; |
| | | formObj.value.usertypeid = b.value; |
| | | formObj.value.usertype = b.label; |
| | | |
| | | // åºæ¯ç±»åä¿¡æ¯å¡«å
|
| | | const c = formObj.value._scenetype; |
| | | formObj.value.extension2 = c.value; |
| | | parseUserInfoReverse(formObj); |
| | | |
| | | return props.create ? createUser(formObj, func) : updateUser(formObj, func); |
| | | } |
| | |
| | | () => props.formInfo, |
| | | (nValue) => { |
| | | _formInfo.value = parseUserInfo(nValue); |
| | | _formObject.value = _formInfo.value; |
| | | } |
| | | ); |
| | | |
| | |
| | | emit('update:isEdit', nValue); |
| | | }); |
| | | |
| | | |
| | | // éç½®å¯ç |
| | | |
| | | const pwLoading = ref(false); |
| | | |
| | | function onResetPw() { |
| | | useMessageBoxTip({ |
| | | confirmMsg: 'æ¯å¦éç½®è¯¥åºæ¯å¯ç ï¼', |
| | | confirmTitle: 'éç½®å¯ç ', |
| | | onConfirm: async () => { |
| | | pwLoading.value = true |
| | | _formObject.value.password = '123456'; |
| | | await updateUser(_formObject); |
| | | pwLoading.value = false |
| | | } |
| | | }); |
| | | } |
| | | </script> |