| | |
| | | * èªå¨åå»ºè´¦æ· |
| | | */ |
| | | 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 |
| | |
| | | return $fysp |
| | | .get(`userinfo/type/get`, { params: { typeId, enable } }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | searchUser(areaVo, keyword, page, perPage) { |
| | | return $fysp |
| | | .post(`userinfo/search`, areaVo, { |
| | | params: { keyword, userType: 3, page, perPage } |
| | | }) |
| | | .then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | */ |
| | | fetchDeviceMap(param) { |
| | | return $fysp.post(`usermap/device`, param).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * æç´¢ç¬¬ä¸æ¹è®¾å¤ |
| | | */ |
| | | searchThirdPartyDevice(areaVo, keyword, page, perPage) { |
| | | return $fysp |
| | | .post(`usermap/searchThirdPartyDevice`, areaVo, { |
| | | params: { keyword, page, perPage } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | insertOrUpdate(areaVo, deviceMap) { |
| | | return $fysp |
| | | .post(`usermap/insertOrUpdate`, { first: areaVo, second: deviceMap }) |
| | | .then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | FYSearchBar: typeof import('./components/search-option/FYSearchBar.vue')['default'] |
| | | FYTable: typeof import('./components/table/FYTable.vue')['default'] |
| | | Header: typeof import('./components/core/Header.vue')['default'] |
| | | ItemDevice: typeof import('./components/list-item/ItemDevice.vue')['default'] |
| | | ItemMonitorObj: typeof import('./components/list-item/ItemMonitorObj.vue')['default'] |
| | | ItemScene: typeof import('./components/list-item/ItemScene.vue')['default'] |
| | | ItemSubTask: typeof import('./components/list-item/ItemSubTask.vue')['default'] |
| | |
| | | sysNames: [ |
| | | { name: 'é£ç¾½ç管', des: '' }, |
| | | { name: 'é£ç¾½ç¯å¢', des: '' }, |
| | | { name: 'ææ±¡æ½è¿', des: '' } |
| | | // { name: 'ææ±¡æ½è¿', des: '' } |
| | | ] |
| | | }; |
| | | }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="wrapper"> |
| | | <div> |
| | | <el-text>{{ item.deviceName }}</el-text> |
| | | <el-divider direction="vertical" /> |
| | | <el-text>设å¤ç¼ç ï¼{{ item.deviceCode }}</el-text> |
| | | </div> |
| | | <el-row justify="space-between" style="margin-top: 4px"> |
| | | <el-space> |
| | | <el-tag type="primary" effect="plain" size="small"> |
| | | {{ item.district }} |
| | | </el-tag> |
| | | </el-space> |
| | | <el-button size="small" type="success" @click="add">æ·»å </el-button> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | const props = defineProps({ |
| | | item: { |
| | | type: Object, |
| | | default: () => {} |
| | | } |
| | | }); |
| | | |
| | | const emit = defineEmits(['add']); |
| | | |
| | | function add() { |
| | | emit('add', props.item); |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .wrapper { |
| | | border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-border-radius-base); |
| | | padding: 4px 8px; |
| | | } |
| | | </style> |
| | |
| | | // import 'element-plus/dist/index.css'; |
| | | import './assets/main.css'; |
| | | |
| | | import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; |
| | | import 'element-plus/theme-chalk/src/overlay.scss'; |
| | | import 'element-plus/theme-chalk/src/message.scss'; |
| | | import 'element-plus/theme-chalk/src/message-box.scss'; |
| | |
| | | // echarts |
| | | import * as echarts from 'echarts' |
| | | |
| | | |
| | | dayjs.extend(isSameOrAfter); |
| | | dayjs.extend(isSameOrBefore); |
| | | |
| | |
| | | |
| | | app.config.globalProperties.$fm = timeUtil; |
| | | app.config.globalProperties.$echarts = echarts |
| | | app.config.globalProperties.$message = ElMessage |
| | | app.config.globalProperties.$notification = ElNotification |
| | | app.config.globalProperties.$messageBox = ElMessageBox |
| | | |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component); |
| | |
| | | :type="2" |
| | | v-model:value="formSearch.scenetype" |
| | | ></FYOptionScene> |
| | | <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime> |
| | | <FYOptionTime |
| | | :initValue="false" |
| | | type="month" |
| | | v-model:value="formSearch.time" |
| | | ></FYOptionTime> |
| | | </template> |
| | | <template #buttons> </template> |
| | | |
| | |
| | | </template> --> |
| | | |
| | | <template #table-column> |
| | | <el-table-column fixed="left" type="index" label="#" width="40" index="1"></el-table-column> |
| | | <el-table-column |
| | | fixed="left" |
| | | type="index" |
| | | label="#" |
| | | width="40" |
| | | index="1" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="deviceCode" |
| | | :show-overflow-tooltip="true" |
| | |
| | | width="160" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" :show-overflow-tooltip="true" label="çæµè®¾å¤åç§°"> |
| | | <el-table-column |
| | | prop="deviceName" |
| | | :show-overflow-tooltip="true" |
| | | label="çæµè®¾å¤åç§°" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="svUserName" :show-overflow-tooltip="true" label="çç®¡ç¨æ·åç§°"> |
| | | <el-table-column |
| | | prop="svUserName" |
| | | :show-overflow-tooltip="true" |
| | | label="çç®¡ç¨æ·åç§°" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="tzUserName" :show-overflow-tooltip="true" label="宿³èªå©ç¨æ·åç§°"> |
| | | <el-table-column |
| | | prop="tzUserName" |
| | | :show-overflow-tooltip="true" |
| | | label="宿³èªå©ç¨æ·åç§°" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="createTime" |
| | |
| | | :formatter="timeFormat" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="æä½" width="100"> |
| | | <el-table-column fixed="right" label="æä½" width="150"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" size="small" @click="itemEdit(row)">ç¼è¾</el-button> |
| | | <el-button |
| | | v-show="row.deviceCode" |
| | | type="primary" |
| | | size="small" |
| | | @click="itemEdit(row)" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button type="success" size="small" @click="itemAdd(row)" |
| | | >æ·»å 设å¤</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | size="80%" |
| | | destroy-on-close |
| | | > |
| | | <CompDeviceMatchEdit :data="selectedItem" :area="area"></CompDeviceMatchEdit> |
| | | <CompDeviceMatchEdit |
| | | :data="selectedItem" |
| | | :area="area" |
| | | @save="onSave" |
| | | ></CompDeviceMatchEdit> |
| | | </el-drawer> |
| | | </template> |
| | | <script setup> |
| | |
| | | selectedItem.value = row; |
| | | drawerShow.value = true; |
| | | } |
| | | |
| | | /** |
| | | * åç¨æ·æ·»å æ°è®¾å¤ |
| | | * ä¸ä¼ é主é®idå设å¤ä¿¡æ¯ï¼ä»¥æ¤è¡¨ç¤ºéè¦æ·»å æ°çè®¾å¤ |
| | | * @param row éä¸çè¡æ°æ® |
| | | */ |
| | | function itemAdd(row) { |
| | | selectedItem.value = { |
| | | svUserName: row.svUserName, |
| | | tzUserName: row.tzUserName, |
| | | svUserId: row.svUserId, |
| | | tzUserId: row.tzUserId |
| | | }; |
| | | drawerShow.value = true; |
| | | } |
| | | |
| | | function onSave() { |
| | | tableRef.value.onSearch(); |
| | | drawerShow.value = false; |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-row justify="end"> |
| | | <el-button icon="check" type="success" @click="save" :loading="saveLoading" |
| | | >ä¿å</el-button |
| | | > |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <CompInfoSearch |
| | |
| | | <div> |
| | | <el-text>ç¼å·ï¼{{ row.deviceCode }}</el-text> |
| | | </div> |
| | | <div> |
| | | <el-space> |
| | | <el-text>åç§°ï¼{{ row.deviceName }}</el-text> |
| | | </div> |
| | | <el-button |
| | | v-show="row.deviceName" |
| | | type="primary" |
| | | icon="DocumentCopy" |
| | | text |
| | | circle |
| | | @click="copyDeviceName(row.deviceName)" |
| | | /> |
| | | </el-space> |
| | | </template> |
| | | <template #default="{ row, click }"> |
| | | <el-text>deviceInfo</el-text> |
| | | <ItemDevice :item="row" @add="selectDevice(row, click)" /> |
| | | </template> |
| | | </CompInfoSearch> |
| | | </el-col> |
| | |
| | | <div> |
| | | <el-text>ç¼å·ï¼{{ row.svUserId }}</el-text> |
| | | </div> |
| | | <div> |
| | | <el-space> |
| | | <el-text>åç§°ï¼{{ row.svUserName }}</el-text> |
| | | </div> |
| | | <el-button |
| | | v-show="row.svUserName" |
| | | type="primary" |
| | | icon="DocumentCopy" |
| | | text |
| | | circle |
| | | @click="copySVUser(row.svUserName)" |
| | | /> |
| | | </el-space> |
| | | </template> |
| | | <template #default="{ row, click }"> |
| | | <ItemUser :item="row" @add="selectSVUser(row, click)" /> |
| | |
| | | <div> |
| | | <el-text>ç¼å·ï¼{{ row.tzUserId }}</el-text> |
| | | </div> |
| | | <div> |
| | | <el-space> |
| | | <el-text>åç§°ï¼{{ row.tzUserName }}</el-text> |
| | | </div> |
| | | <el-button |
| | | v-show="row.tzUserName" |
| | | type="primary" |
| | | icon="DocumentCopy" |
| | | text |
| | | circle |
| | | @click="copyTZUser(row.tzUserName)" |
| | | /> |
| | | </el-space> |
| | | </template> |
| | | <template #default="{ row, click }"> |
| | | <ItemUser :item="row" @add="selectTZUser(row, click)" /> |
| | |
| | | import CompInfoSearch from './CompInfoSearch.vue'; |
| | | import tzUserApi from '@/api/fytz/userApi'; |
| | | import svUserApi from '@/api/fysp/userApi'; |
| | | import userMapApi from '@/api/fysp/userMapApi'; |
| | | import { svToTz } from '@/enum/scene'; |
| | | import { saveAs } from 'file-saver'; |
| | | |
| | | export default { |
| | | components: { CompInfoSearch }, |
| | |
| | | // æ£ç´¢èå´ï¼å
å«è¡æ¿åºåãåºæ¯ç±»åï¼ |
| | | area: Object |
| | | }, |
| | | emits: ['save'], |
| | | data() { |
| | | return { |
| | | // çæµè®¾å¤ |
| | |
| | | // çç®¡ç¨æ· |
| | | svUser: {}, |
| | | // ç¯å¢ç¨æ· |
| | | tzUser: {} |
| | | tzUser: {}, |
| | | // ä¿åloading |
| | | saveLoading: false |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | methods: { |
| | | // æ¥è¯¢çæµè®¾å¤ |
| | | searchDevice() {}, |
| | | searchDevice(param, callback) { |
| | | const { text, page, pageSize } = param; |
| | | const { cloned: area } = useCloned(this.area); |
| | | return userMapApi |
| | | .searchThirdPartyDevice(area.value, text, page, pageSize) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | const l = res.data.map((value) => { |
| | | return { |
| | | deviceCode: value.mnCode, |
| | | deviceName: value.name, |
| | | district: area.value.districtname |
| | | }; |
| | | }); |
| | | callback({ |
| | | data: l, |
| | | total: res.head.totalCount |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | // æ¥è¯¢çç®¡ç¨æ· |
| | | searchSVUser(param, callback) { |
| | | const { text, page, pageSize } = param; |
| | |
| | | area.townCode = this.area.towncode; |
| | | area.townName = this.area.townname; |
| | | // åºæ¯ç±»å |
| | | const tzSceneType = svToTz(this.area.scensetypeid) |
| | | const tzSceneType = svToTz(this.area.scensetypeid); |
| | | area.sceneTypes = [tzSceneType.value]; |
| | | // ä¸ä¸çº¿ç¶æ |
| | | area.online = this.area.online; |
| | |
| | | callback(); |
| | | }); |
| | | }, |
| | | selectDevice() {}, |
| | | selectDevice(row, click) { |
| | | const p = { |
| | | deviceCode: row.deviceCode, |
| | | deviceName: row.deviceName |
| | | }; |
| | | click(p); |
| | | }, |
| | | selectSVUser(row, click) { |
| | | const p = { |
| | | svUserId: row.guid, |
| | |
| | | tzUserName: row.realname |
| | | }; |
| | | click(p); |
| | | }, |
| | | // å¤å¶çç®¡ç¨æ· |
| | | copySVUser(svUserName) { |
| | | // 使ç¨Clipboard APIå°ç¨æ·åç§°å¤å¶å°åªè´´æ¿ |
| | | navigator.clipboard |
| | | .writeText(svUserName) |
| | | .then(() => { |
| | | this.$message({ |
| | | message: 'çç®¡ç¨æ·åç§°å·²å¤å¶å°åªè´´æ¿', |
| | | type: 'success' |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ |
| | | message: 'å¤å¶å¤±è´¥ï¼è¯·æå¨å¤å¶', |
| | | type: 'error' |
| | | }); |
| | | console.error('å¤å¶å¤±è´¥:', err); |
| | | }); |
| | | }, |
| | | // å¤å¶ç¯å¢ç¨æ· |
| | | copyTZUser(tzUserName) { |
| | | // 使ç¨Clipboard APIå°ç¨æ·åç§°å¤å¶å°åªè´´æ¿ |
| | | navigator.clipboard |
| | | .writeText(tzUserName) |
| | | .then(() => { |
| | | this.$message({ |
| | | message: 'ç¯å¢ç¨æ·åç§°å·²å¤å¶å°åªè´´æ¿', |
| | | type: 'success' |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ |
| | | message: 'å¤å¶å¤±è´¥ï¼è¯·æå¨å¤å¶', |
| | | type: 'error' |
| | | }); |
| | | console.error('å¤å¶å¤±è´¥:', err); |
| | | }); |
| | | }, |
| | | // å¤å¶çæµè®¾å¤åç§° |
| | | copyDeviceName(deviceName) { |
| | | // 使ç¨Clipboard APIå°ç¨æ·åç§°å¤å¶å°åªè´´æ¿ |
| | | navigator.clipboard |
| | | .writeText(deviceName) |
| | | .then(() => { |
| | | this.$message({ |
| | | message: 'çæµè®¾å¤åç§°å·²å¤å¶å°åªè´´æ¿', |
| | | type: 'success' |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ |
| | | message: 'å¤å¶å¤±è´¥ï¼è¯·æå¨å¤å¶', |
| | | type: 'error' |
| | | }); |
| | | console.error('å¤å¶å¤±è´¥:', err); |
| | | }); |
| | | }, |
| | | // ä¿å |
| | | save() { |
| | | const deviceMap = { |
| | | id: this.data.id, |
| | | ...this.device, |
| | | ...this.svUser, |
| | | ...this.tzUser |
| | | }; |
| | | this.saveLoading = true; |
| | | userMapApi |
| | | .insertOrUpdate(this.area, deviceMap) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | this.$message({ |
| | | message: 'ä¿åæå', |
| | | type: 'success' |
| | | }); |
| | | this.$emit('save', deviceMap); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.saveLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }; |