| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | row-class-name="tabFontSize" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | row-class-name="tabFontSize" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @row-click="rowClick" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="mini" |
| | | icon="el-icon-delete" |
| | | v-if="permission.tenant_delete" |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | <el-button |
| | | type="danger" |
| | | size="mini" |
| | | icon="el-icon-delete" |
| | | v-if="permission.tenant_delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | <!-- <el-button size="small"--> |
| | | <!-- plain--> |
| | | <!-- v-if="userInfo.role_name.includes('administrator')"--> |
| | | <!-- icon="el-icon-setting"--> |
| | | <!-- @click="handleSetting">授权配置--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button size="small"--> |
| | | <!-- plain--> |
| | | <!-- v-if="userInfo.role_name.includes('administrator')"--> |
| | | <!-- icon="el-icon-coin"--> |
| | | <!-- @click="handleDatasource">数据源配置--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button size="small"--> |
| | | <!-- plain--> |
| | | <!-- v-if="userInfo.role_name.includes('administrator')"--> |
| | | <!-- icon="el-icon-setting"--> |
| | | <!-- @click="handleSetting">授权配置--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button size="small"--> |
| | | <!-- plain--> |
| | | <!-- v-if="userInfo.role_name.includes('administrator')"--> |
| | | <!-- icon="el-icon-coin"--> |
| | | <!-- @click="handleDatasource">数据源配置--> |
| | | <!-- </el-button>--> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="accountNumber"> |
| | | <el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag> |
| | | <template slot-scope="{ row }" slot="accountNumber"> |
| | | <el-tag>{{ |
| | | row.accountNumber > 0 ? row.accountNumber : "不限制" |
| | | }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="expireTime"> |
| | | <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag> |
| | | <template slot-scope="{ row }" slot="expireTime"> |
| | | <el-tag>{{ row.expireTime ? row.expireTime : "不限制" }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="type"> |
| | | <el-tag>{{row.type==='0'?'医院':row.type==='1'?'学校':row.type==='2'?'小区':'未知'}}</el-tag> |
| | | <template slot-scope="{ row }" slot="type"> |
| | | <el-tag>{{ |
| | | row.type === "0" |
| | | ? "医院" |
| | | : row.type === "1" |
| | | ? "学校" |
| | | : row.type === "2" |
| | | ? "小区" |
| | | : "未知" |
| | | }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="租户授权配置" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="450px"> |
| | | <avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit"/> |
| | | <el-dialog |
| | | title="租户授权配置" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="450px" |
| | | > |
| | | <avue-form |
| | | :option="settingOption" |
| | | v-model="settingForm" |
| | | @submit="handleSubmit" |
| | | /> |
| | | </el-dialog> |
| | | <el-dialog title="租户数据源配置" |
| | | append-to-body |
| | | :visible.sync="datasourceBox" |
| | | width="450px"> |
| | | <avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit"/> |
| | | <el-dialog |
| | | title="租户数据源配置" |
| | | append-to-body |
| | | :visible.sync="datasourceBox" |
| | | width="450px" |
| | | > |
| | | <avue-form |
| | | :option="datasourceOption" |
| | | v-model="datasourceForm" |
| | | @submit="handleDatasourceSubmit" |
| | | /> |
| | | </el-dialog> |
| | | <!-- 右侧弹窗,业主的设备 --> |
| | | <el-dialog |
| | | :title="onceData.tenantName" |
| | | :visible.sync="dialogVisible" |
| | | width="620px" |
| | | :before-close="handleClose" |
| | | modal-append-to-body="false" |
| | | append-to-body="true" |
| | | class="right-open" |
| | | > |
| | | <el-divider content-position="left">点击查看详情</el-divider> |
| | | <div class="r-o-our"> |
| | | <!-- <avue-crud :data="datas" :option="options" @row-click="rowClicks"> |
| | | <template slot-scope="{ row }" slot="devicestate"> |
| | | <el-tag |
| | | >{{ |
| | | row.devicestate == "0" |
| | | ? "撤防" |
| | | : row.devicestate == "1" |
| | | ? "布防" |
| | | : "无" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="dxzt"> |
| | | <el-tag |
| | | >{{ row.dxzt == "0" ? "掉线" : row.dxzt == "1" ? "在线" : "无" }} |
| | | </el-tag> |
| | | </template> |
| | | </avue-crud> --> |
| | | <el-table |
| | | :data="datas" |
| | | style="width: 603px; height: auto" |
| | | stripe="true" |
| | | @row-click="rowClicks" |
| | | class="r-o-o-table" |
| | | border="true" |
| | | > |
| | | <el-table-column prop="deviceName" label="设备名称" width="300"> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceNumber" label="设备编号" width="120"> |
| | | </el-table-column> |
| | | <el-table-column prop="stateSevicestate" label="布撤防状态" width="100"> |
| | | </el-table-column> |
| | | <el-table-column prop="stateOnline" ref="stateOnline" label="设备状态" width="80"> </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, remove, update, add, setting, datasource,instery,updateInfoy,selectTy,insertss,updateInfos,selectTs,insertsr,updateInfor,selectTr,deletey,deletes,deleter} from "@/api/system/tenant"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getAll } from "@/api/client/client"; |
| | | import { |
| | | getList, |
| | | getDetail, |
| | | remove, |
| | | update, |
| | | add, |
| | | setting, |
| | | datasource, |
| | | instery, |
| | | updateInfoy, |
| | | selectTy, |
| | | insertss, |
| | | updateInfos, |
| | | selectTs, |
| | | insertsr, |
| | | updateInfor, |
| | | selectTr, |
| | | deletey, |
| | | deletes, |
| | | deleter, |
| | | } from "@/api/system/tenant"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from "@/config/website"; |
| | | import {getRoleTree} from "@/api/system/role"; |
| | | import AvueMap from 'avue-plugin-map' |
| | | import { getRoleTree } from "@/api/system/role"; |
| | | import AvueMap from "avue-plugin-map"; |
| | | var that; |
| | | export default { |
| | | |
| | | data() { |
| | | that = this; |
| | | return { |
| | |
| | | loading: true, |
| | | box: false, |
| | | datasourceBox: false, |
| | | dialogVisible: false, //右侧弹窗 |
| | | onceData: {}, //数据 |
| | | win: {}, //样式 |
| | | datas: "", //cc |
| | | // options: { |
| | | // addBtn: false, |
| | | // height: 'auto', |
| | | // menu: false, |
| | | // header: false, |
| | | // calcHeight: 80, |
| | | // stripe:true, |
| | | // title: "表格的标题", |
| | | // titleSize: "h3", |
| | | // titleStyle: { |
| | | // color: "red", |
| | | // }, |
| | | // page: false, |
| | | // align: "center", |
| | | // menuAlign: "center", |
| | | // column: [ |
| | | // { |
| | | // label: "设备名称", |
| | | // prop: "deviceName", |
| | | // width: 180, |
| | | // }, |
| | | // { |
| | | // label: "设备编号", |
| | | // prop: "deviceNumber", |
| | | // width: 150, |
| | | // }, |
| | | // { |
| | | // label: "布撤防状态", |
| | | // prop: "devicestate", |
| | | // type: "select", |
| | | // slot: true, |
| | | // width: 100, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择布撤防状态", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // dicData: [ |
| | | // { |
| | | // label: "撤防", |
| | | // value: "0", |
| | | // }, |
| | | // { |
| | | // label: "布防", |
| | | // value: "1", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | // { |
| | | // label: "设备状态", |
| | | // prop: "dxzt", |
| | | // slot: true, |
| | | // addDisplay: false, |
| | | // editDisplay: false, |
| | | // }, |
| | | // ], |
| | | // }, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | height: "auto", |
| | | calcHeight: 80, |
| | | size: "mini", |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | stripe:true, |
| | | stripe: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | span: 24, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入租户ID", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入租户ID", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "客户名称", |
| | |
| | | width: 190, |
| | | span: 12, |
| | | searchSpan: 3, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入参数名称", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入参数名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "联系人", |
| | |
| | | width: 100, |
| | | search: true, |
| | | searchSpan: 3, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入联系人", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入联系人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | value: "code", |
| | | }, |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 6, |
| | | className: "cityClass1" |
| | | className: "cityClass1", |
| | | }, |
| | | { |
| | | label: "地市", |
| | |
| | | search: true, |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | value: "code", |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass2" |
| | | className: "cityClass2", |
| | | }, |
| | | { |
| | | label: "区县", |
| | |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | value: "code", |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass3" |
| | | className: "cityClass3", |
| | | }, |
| | | { |
| | | label: '地址', |
| | | prop: 'map', |
| | | label: "地址", |
| | | prop: "map", |
| | | hide: true, |
| | | span: 24, |
| | | component: "AvueMap", |
| | | }, |
| | | { |
| | | label: '纬度', |
| | | label: "纬度", |
| | | hide: true, |
| | | addDisplay: false, |
| | | prop: 'wd', |
| | | prop: "wd", |
| | | }, |
| | | { |
| | | label: '经度', |
| | | label: "经度", |
| | | hide: true, |
| | | addDisplay: false, |
| | | prop: 'jd', |
| | | prop: "jd", |
| | | }, |
| | | { |
| | | label: "账号额度", |
| | |
| | | prop: "type", |
| | | width: 80, |
| | | type: "select", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择类型", |
| | | trigger: "blur" |
| | | }], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | dicData: [ |
| | | { |
| | | label: "医院", |
| | | value: "0" |
| | | value: "0", |
| | | }, |
| | | { |
| | | label: "学校", |
| | | value: "1" |
| | | value: "1", |
| | | }, |
| | | { |
| | | label: "小区", |
| | | value: "2" |
| | | } |
| | | value: "2", |
| | | }, |
| | | ], |
| | | change: function (value,column) { |
| | | change: function (value, column) { |
| | | if (value.value == "0") { |
| | | that.option.group = [ |
| | | { |
| | | label: '详细信息', |
| | | prop: 'detailInfo', |
| | | icon: 'el-icon-s-order', |
| | | label: "详细信息", |
| | | prop: "detailInfo", |
| | | icon: "el-icon-s-order", |
| | | column: [ |
| | | { |
| | | label: "医院等级", |
| | |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | value:"" |
| | | value: "", |
| | | }, |
| | | checkStrictly: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入医院等级", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入医院等级", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "医院类别", |
| | | prop: "ht", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入医院类别", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入医院类别", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "成立时间", |
| | |
| | | prop: "ctime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入成立时间", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop:"had", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入地址", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入成立时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "介绍", |
| | | prop: "content", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入介绍", |
| | | trigger: "blur" |
| | | }], |
| | | span:24, |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | else if (value.value=="1"){ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入介绍", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | } else if (value.value == "1") { |
| | | that.option.group = [ |
| | | { |
| | | label: '详细信息', |
| | | prop: 'dutyInfo', |
| | | icon: 'el-icon-s-custom', |
| | | label: "详细信息", |
| | | prop: "dutyInfo", |
| | | icon: "el-icon-s-custom", |
| | | column: [ |
| | | { |
| | | label: "学校性质", |
| | |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | value:"" |
| | | value: "", |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入学校性质", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入学校性质", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "校训", |
| | | prop: "motto", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入校训", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入校训", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "创办时间", |
| | |
| | | prop: "ctime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入创办时间" |
| | | }] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop:"had", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入地址" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入创办时间", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "介绍", |
| | | prop: "content", |
| | | span:24, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入介绍" |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | else if (value.value=="2") { |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入介绍", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | } else if (value.value == "2") { |
| | | that.option.group = [ |
| | | { |
| | | label: '详细信息', |
| | | prop: 'baseInfo', |
| | | icon: 'el-icon-s-solid', |
| | | label: "详细信息", |
| | | prop: "baseInfo", |
| | | icon: "el-icon-s-solid", |
| | | column: [ |
| | | { |
| | | label: "小区类别", |
| | |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | value:"" |
| | | value: "", |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区类别" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入小区类别", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "小区属性", |
| | | prop: "attributes", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区属性" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入小区属性", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "开发商", |
| | | prop:"developers", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入开发商" |
| | | }] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop:"had", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入地址" |
| | | }] |
| | | prop: "developers", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入开发商", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "户型", |
| | | prop:"housetype", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入户型" |
| | | }] |
| | | prop: "housetype", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入户型", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "介绍", |
| | | prop: "content", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入介绍" |
| | | }], |
| | | span:24, |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入介绍", |
| | | }, |
| | | ], |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | } else { |
| | | that.option.group = []; |
| | | } |
| | | else { |
| | | that.option.group =[] |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "绑定域名", |
| | |
| | | { |
| | | label: "系统背景", |
| | | prop: "backgroundUrl", |
| | | type: 'upload', |
| | | listType: 'picture-img', |
| | | action: '/api/blade-resource/oss/endpoint/put-file', |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: 'data', |
| | | url: 'link', |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | hide: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | group: [ |
| | | ] |
| | | group: [], |
| | | }, |
| | | data: [], |
| | | settingForm: {}, |
| | |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | span: 24, |
| | | }, |
| | | ] |
| | | ], |
| | | }, |
| | | datasourceForm: {}, |
| | | datasourceOption: { |
| | |
| | | dicUrl: "/api/blade-develop/datasource/select", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | value: "id", |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择数据源", |
| | | trigger: "blur" |
| | | }] |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择数据源", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | //报错: TypeError: val is undefined 处理时间2021.4.10,处理人 liuyg |
| | | // watch:{ |
| | | // 'form.map':{// form是表单或者表格绑定的数据集,v-model='form' |
| | | // handler(val){ |
| | | // this.form.jd = val.latitude |
| | | // this.form.wd = val.longitude |
| | | // }, |
| | | // immediate: true |
| | | // } |
| | | // }, |
| | | watch: { |
| | | "form.map": { |
| | | // form是表单或者表格绑定的数据集,v-model='form' |
| | | handler(val) { |
| | | if (val) { |
| | | this.form.wd = val.latitude; |
| | | this.form.jd = val.longitude; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | |
| | | addBtn: this.vaildData(this.permission.tenant_add, false), |
| | | viewBtn: this.vaildData(this.permission.tenant_view, false), |
| | | delBtn: this.vaildData(this.permission.tenant_delete, false), |
| | | editBtn: this.vaildData(this.permission.tenant_edit, false) |
| | | editBtn: this.vaildData(this.permission.tenant_edit, false), |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | tenantId() { |
| | | return this.selectionList[0].tenantId; |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | if (row.type=="0"){ |
| | | instery(row.dj,row.had,row.ht,row.ctime,row.content,row.tenantName); |
| | | add(row).then( |
| | | () => { |
| | | if (row.type == "0") { |
| | | console.log(123); |
| | | instery( |
| | | row.dj, |
| | | // row.had, |
| | | row.ht, |
| | | row.ctime, |
| | | row.content, |
| | | row.tenantName |
| | | ); |
| | | } else if (row.type == "1") { |
| | | insertss( |
| | | row.dj, |
| | | row.nature, |
| | | // row.had, |
| | | row.motto, |
| | | row.ctime, |
| | | row.content, |
| | | row.tenantName |
| | | ); |
| | | } else if (row.type == "2") { |
| | | insertsr( |
| | | row.dj, |
| | | row.category, |
| | | row.attributes, |
| | | row.developers, |
| | | // row.had, |
| | | row.housetype, |
| | | row.content, |
| | | row.hn |
| | | ); |
| | | } |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | else if (row.type=="1"){ |
| | | insertss(row.nature,row.had,row.motto,row.ctime,row.content,row.tenantName); |
| | | } |
| | | else if (row.type=="2") { |
| | | insertsr(row.category, row.attributes, row.developers,row.had, row.housetype, row.content, row.hn) |
| | | } |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (row.type=="0"){ |
| | | updateInfoy(row.dj,row.had,row.ht,row.ctime,row.content,row.tenantName); |
| | | if (row.type == "0") { |
| | | updateInfoy( |
| | | row.dj, |
| | | row.had, |
| | | row.ht, |
| | | row.ctime, |
| | | row.content, |
| | | row.tenantName |
| | | ); |
| | | } else if (row.type == "1") { |
| | | updateInfos( |
| | | row.dj, |
| | | row.nature, |
| | | row.had, |
| | | row.motto, |
| | | row.ctime, |
| | | row.content, |
| | | row.tenantName |
| | | ); |
| | | } else if (row.type == "2") { |
| | | updateInfor( |
| | | row.dj, |
| | | row.category, |
| | | row.attributes, |
| | | row.developers, |
| | | row.had, |
| | | row.housetype, |
| | | row.content, |
| | | row.tenantName |
| | | ); |
| | | } |
| | | else if (row.type=="1"){ |
| | | updateInfos(row.nature,row.had,row.motto,row.ctime,row.content,row.tenantName); |
| | | } |
| | | else if (row.type=="2"){ |
| | | updateInfor(row.category, row.attributes, row.developers,row.had, row.housetype, row.content, row.tenantName) |
| | | } |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | if (row.type=="0"){ |
| | | deletey(row.tenantName) |
| | | } |
| | | else if (row.type=="1"){ |
| | | deletes(row.tenantName) |
| | | } |
| | | else if (row.type=="2"){ |
| | | deleter(row.tenantName) |
| | | if (row.type == "0") { |
| | | deletey(row.tenantName); |
| | | } else if (row.type == "1") { |
| | | deletes(row.tenantName); |
| | | } else if (row.type == "2") { |
| | | deleter(row.tenantName); |
| | | } |
| | | return remove(row.id); |
| | | }) |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | if (this.form.type=="1"){ |
| | | getDetail(this.form.id).then((res) => { |
| | | if (this.form.type == "1") { |
| | | const data = res.data.data; |
| | | selectTs(this.form.tenantName).then( re=>{ |
| | | selectTs(this.form.tenantName).then((re) => { |
| | | const data = res.data.data; |
| | | data.nature=re.data.data[0].nature |
| | | data.motto=re.data.data[0].motto |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | data.nature = re.data.data[0].nature; |
| | | data.dj = re.data.data[0].dj; |
| | | data.motto = re.data.data[0].motto; |
| | | data.ctime = re.data.data[0].ctime; |
| | | //data.had = re.data.data[0].had; |
| | | data.content = re.data.data[0].content; |
| | | this.form = data; |
| | | }) |
| | | } |
| | | else if (this.form.type=="0"){ |
| | | selectTy(this.form.tenantName).then( re=>{ |
| | | }); |
| | | } else if (this.form.type == "0") { |
| | | selectTy(this.form.tenantName).then((re) => { |
| | | console.log(re, 123); |
| | | const data = res.data.data; |
| | | data.dj=re.data.data[0].dj |
| | | data.ht=re.data.data[0].ht |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | data.dj = re.data.data[0].dj; |
| | | data.ht = re.data.data[0].ht; |
| | | data.ctime = re.data.data[0].ctime; |
| | | //.had = re.data.data[0].had; |
| | | data.content = re.data.data[0].content; |
| | | this.form = data; |
| | | }) |
| | | } |
| | | else if (this.form.type=="2"){ |
| | | selectTr(this.form.tenantName).then( re=>{ |
| | | }); |
| | | } else if (this.form.type == "2") { |
| | | selectTr(this.form.tenantName).then((re) => { |
| | | const data = res.data.data; |
| | | data.category=re.data.data[0].category |
| | | data.attributes=re.data.data[0].attributes |
| | | data.developers=re.data.data[0].developers |
| | | data.had=re.data.data[0].had |
| | | data.housetype=re.data.data[0].housetype |
| | | data.content=re.data.data[0].content |
| | | data.dj = re.data.data[0].dj; |
| | | data.category = re.data.data[0].category; |
| | | data.attributes = re.data.data[0].attributes; |
| | | data.developers = re.data.data[0].developers; |
| | | //data.had = re.data.data[0].had; |
| | | data.housetype = re.data.data[0].housetype; |
| | | data.content = re.data.data[0].content; |
| | | this.form = data; |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | else if (["view"].includes(type)){ |
| | | getDetail(this.form.id).then(res => { |
| | | if (this.form.type=="1") { |
| | | selectTs(this.form.tenantName).then( re=>{ |
| | | } else if (["view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | if (this.form.type == "1") { |
| | | selectTs(this.form.tenantName).then((re) => { |
| | | const data = res.data.data; |
| | | data.nature=re.data.data[0].nature |
| | | data.motto=re.data.data[0].motto |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | data.nature = re.data.data[0].nature; |
| | | data.motto = re.data.data[0].motto; |
| | | data.ctime = re.data.data[0].ctime; |
| | | //data.had = re.data.data[0].had; |
| | | data.content = re.data.data[0].content; |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | } |
| | |
| | | data.expireTime = "不限制"; |
| | | } |
| | | this.form = data; |
| | | }) |
| | | } |
| | | else if (this.form.type=="0"){ |
| | | selectTy(this.form.tenantName).then( re=>{ |
| | | }); |
| | | } else if (this.form.type == "0") { |
| | | selectTy(this.form.tenantName).then((re) => { |
| | | const data = res.data.data; |
| | | data.dj=re.data.data[0].dj |
| | | data.ht=re.data.data[0].ht |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | data.dj = re.data.data[0].dj; |
| | | data.ht = re.data.data[0].ht; |
| | | data.ctime = re.data.data[0].ctime; |
| | | //data.had = re.data.data[0].had; |
| | | data.content = re.data.data[0].content; |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | } |
| | |
| | | data.expireTime = "不限制"; |
| | | } |
| | | this.form = data; |
| | | }) |
| | | } |
| | | else if (this.form.type=="2"){ |
| | | selectTr(this.form.tenantName).then( re=>{ |
| | | }); |
| | | } else if (this.form.type == "2") { |
| | | selectTr(this.form.tenantName).then((re) => { |
| | | const data = res.data.data; |
| | | data.category=re.data.data[0].category |
| | | data.attributes=re.data.data[0].attributes |
| | | data.developers=re.data.data[0].developers |
| | | data.had=re.data.data[0].had |
| | | data.housetype=re.data.data[0].housetype |
| | | data.content=re.data.data[0].content |
| | | data.category = re.data.data[0].category; |
| | | data.attributes = re.data.data[0].attributes; |
| | | data.developers = re.data.data[0].developers; |
| | | //data.had = re.data.data[0].had; |
| | | data.housetype = re.data.data[0].housetype; |
| | | data.content = re.data.data[0].content; |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | } |
| | |
| | | data.expireTime = "不限制"; |
| | | } |
| | | this.form = data; |
| | | }) |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | |
| | | return; |
| | | } |
| | | if (this.selectionList.length === 1) { |
| | | getDetail(this.selectionList[0].id).then(res => { |
| | | getDetail(this.selectionList[0].id).then((res) => { |
| | | const data = res.data.data; |
| | | this.settingForm.accountNumber = data.accountNumber; |
| | | this.settingForm.expireTime = data.expireTime; |
| | | }); |
| | | } else { |
| | | this.settingForm.accountNumber = -1; |
| | | this.settingForm.expireTime = ''; |
| | | this.settingForm.expireTime = ""; |
| | | } |
| | | this.box = true; |
| | | }, |
| | |
| | | this.$message.warning("只能选择一条数据"); |
| | | return; |
| | | } |
| | | getDetail(this.selectionList[0].id).then(res => { |
| | | getDetail(this.selectionList[0].id).then((res) => { |
| | | const data = res.data.data; |
| | | this.datasourceForm.datasourceId = data.datasourceId; |
| | | }); |
| | | this.datasourceBox = true; |
| | | }, |
| | | handleSubmit(form, done, loading) { |
| | | setting(this.ids, form).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.box = false; |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | setting(this.ids, form).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!", |
| | | }); |
| | | done(); |
| | | this.box = false; |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | handleDatasourceSubmit(form, done, loading) { |
| | | datasource(this.tenantId, form.datasourceId).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.datasourceBox = false; |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | datasource(this.tenantId, form.datasourceId).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!", |
| | | }); |
| | | done(); |
| | | this.datasourceBox = false; |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | // console.log(res); |
| | | this.onceData = res.data.data.records[0]; |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | rowClick(val) { |
| | | //行点击事件 //右侧弹窗事件 |
| | | // console.log(val); |
| | | this.onceData = val; |
| | | this.dialogVisible = true; |
| | | }, |
| | | rowClicks(val) { |
| | | //弹窗行点击事件 |
| | | // console.log(val); |
| | | this.$router.push({ path: "/dataL/dataL", query: val }); |
| | | }, |
| | | changeDataOpen(det){ |
| | | if(det.length > 0){ |
| | | for(var key in det){ |
| | | |
| | | det[key].stateOnline = det[key].onlineStatus == "0" ? "掉线" : det[key].onlineStatus == "1" ? "在线" : "无" |
| | | det[key].stateSevicestate = det[key].devicestate == "0" ? "撤防" : det[key].devicestate == "1" ? "布防" : "无" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | getAll().then((res) => { |
| | | //测试数据 |
| | | this.datas = res.data.data; |
| | | this.changeDataOpen(this.datas) |
| | | console.log(this.datas); |
| | | }); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | <style lang="scss" > |
| | | //scoped |
| | | $city-m-l: 10px; |
| | | |
| | | /*页面样式*/ |
| | | .el-card__body .cityClass1 { |
| | | width: 155px; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | /*页面样式clientManagement.vue的样式 liuyg改*/ |
| | | .el-card__body .city1 { |
| | | width: 155px; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | .el-card__body .cityClass2 { |
| | | width: 100px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | .el-card__body .city2 { |
| | | width: 100px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | .el-card__body .cityClass3 { |
| | | width: 100px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | .el-card__body .city3 { |
| | | width: 100px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | /*新增窗体样式*/ |
| | | .el-dialog .cityClass1 { |
| | | width: 220px; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | /*新增窗体样式*/ |
| | | .el-dialog .city1 { |
| | | width: 210px; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | .el-dialog .cityClass2 { |
| | | width: 130px; |
| | | padding-left: 5px !important; |
| | | padding-right: 5px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | .el-dialog .city2 { |
| | | width: 105px; |
| | | padding-left: 5px !important; |
| | | padding-right: 5px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | .el-dialog .cityClass3 { |
| | | width: 130px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | .el-dialog .city3 { |
| | | width: 105px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | .city2 div label { |
| | | display: none; |
| | | } |
| | | |
| | | .cityClass2 div label { |
| | | display: none; |
| | | } |
| | | .city3 div label { |
| | | display: none; |
| | | } |
| | | |
| | | .cityClass3 div label { |
| | | display: none; |
| | | } |
| | | /*页面样式*/ |
| | | .el-card__body .cityClass1 { |
| | | width: 155px; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | .tabFontSize{ |
| | | font-size: 15px; |
| | | } |
| | | .el-card__body .cityClass2 { |
| | | width: 100px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | .el-input__inner{ |
| | | .el-card__body .cityClass3 { |
| | | width: 100px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | margin-left: $city-m-l; |
| | | } |
| | | |
| | | /*新增窗体样式*/ |
| | | .el-dialog .cityClass1, |
| | | .el-dialog .cityClass2, |
| | | .el-dialog .cityClass3 { |
| | | margin-left: $city-m-l; |
| | | position: relative; |
| | | left: -10px; |
| | | } |
| | | .el-dialog .cityClass1 { |
| | | width: 220px; |
| | | padding-right: 0px !important; |
| | | } |
| | | |
| | | .el-dialog .cityClass2 { |
| | | width: 130px; |
| | | padding-left: 5px !important; |
| | | padding-right: 5px !important; |
| | | } |
| | | |
| | | .el-dialog .cityClass3 { |
| | | width: 130px; |
| | | padding-left: 0px !important; |
| | | padding-right: 0px !important; |
| | | } |
| | | |
| | | .cityClass2 div label { |
| | | display: none; |
| | | } |
| | | |
| | | .cityClass3 div label { |
| | | display: none; |
| | | } |
| | | |
| | | .tabFontSize { |
| | | font-size: 15px; |
| | | } |
| | | |
| | | .el-input__inner { |
| | | width: aotu; |
| | | } |
| | | .right-open { |
| | | //右侧弹窗样式 |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: Center; |
| | | overflow: hidden; |
| | | |
| | | .el-dialog { |
| | | margin: 0 auto !important; |
| | | height: 98%; |
| | | overflow: hidden; |
| | | position: fixed; |
| | | top: 1%; |
| | | right: 0; |
| | | .el-dialog__body { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 54px; |
| | | bottom: 0; |
| | | right: 0; |
| | | padding: 0; |
| | | z-index: 1; |
| | | overflow: hidden; |
| | | overflow-y: auto; |
| | | } |
| | | } |
| | | @keyframes dialog-fade-in { |
| | | 0% { |
| | | transform: translate3d(0, 0, 0, 100%); |
| | | opacity: 0; |
| | | } |
| | | 100% { |
| | | transform: translate3d(0, 0, 0, 0); |
| | | opacity: 1; |
| | | } |
| | | } |
| | | @keyframes dialog-fade-out { |
| | | 0% { |
| | | transform: translate3d(0, 0, 0); |
| | | opacity: 1; |
| | | } |
| | | 100% { |
| | | transform: translate3d(0, 0, 0); |
| | | opacity: 0; |
| | | } |
| | | } |
| | | .r-o-our { |
| | | width: calc(100% - 2px); |
| | | height: calc(100% - 28px); |
| | | // border: hotpink 1px solid; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | .r-o-o-table{ |
| | | // border: rgb(69, 36, 146) 1px solid; |
| | | position: relative; |
| | | left: 8px; |
| | | } |
| | | </style> |