| | |
| | | > <i |
| | | :title="$t('common.iquery')" |
| | | slot="suffix" |
| | | @click="setListDataStart" |
| | | @click="getResTableData" |
| | | class="el-icon-search" |
| | | style="padding-right: 8px" |
| | | ></i></el-input> |
| | | </el-form-item> |
| | | <!-- 服务类别 --> |
| | | <el-form-item> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.category" |
| | | :placeholder="$t('dataManage.layerObj.prompt18')" |
| | | @change="getResTableData" |
| | | > |
| | | <el-option |
| | | v-for="item in serviceType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 数据类型 --> |
| | | <el-form-item> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.data" |
| | | :placeholder="$t('dataManage.layerObj.prompt8')" |
| | | @change="getResTableData" |
| | | > |
| | | <el-option |
| | | v-for="item in dataType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 服务类别 --> |
| | | <el-form-item> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.type" |
| | | :placeholder="$t('dataManage.layerObj.prompt3')" |
| | | @change="getResTableData" |
| | | > |
| | | <el-option |
| | | v-for="item in dataTypes" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 状态 --> |
| | | <el-form-item> |
| | | <el-select |
| | | size="small" |
| | | v-model="formInline.status" |
| | | :placeholder="$t('dataManage.layerObj.prompt19')" |
| | | @change="getResTableData" |
| | | > |
| | | <el-option |
| | | v-for="item in statusType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item style="float: right;"> |
| | | <el-button |
| | |
| | | res_deletes, |
| | | res_updates, |
| | | res_update, |
| | | token_insertNewToken |
| | | } from "../../api/api"; |
| | | import $ from 'jquery' |
| | | import { getToken } from '../../utils/auth'; |
| | |
| | | |
| | | return { |
| | | formInline: { |
| | | name: null |
| | | name: null, |
| | | type: null, |
| | | data: null, |
| | | category: null, |
| | | status: null |
| | | }, |
| | | menuStatus: { |
| | | delete: false, |
| | |
| | | editDialog: false, |
| | | insertDialog: false, |
| | | dataType: [], |
| | | dataTypes: [], |
| | | serviceType: [], |
| | | categoryType: [], |
| | | insertDisabled: false, |
| | |
| | | isFullscreen: false, |
| | | prevDialog: false, |
| | | showMapView: false, |
| | | statusType: [ |
| | | { |
| | | label: '禁用', value: 0 |
| | | }, |
| | | { |
| | | label: '启用原始地址', value: 1 |
| | | }, { |
| | | label: '启用代理地址', value: 2 |
| | | } |
| | | ], resToken: null, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | window.removeEventListener("resize", this.onResize); |
| | | }, |
| | | methods: { |
| | | async getResToken() { |
| | | if (this.$store.state.resToken) { |
| | | this.resToken = this.$store.state.resToken |
| | | } else { |
| | | const data = await token_insertNewToken({ |
| | | type: 1, |
| | | min: 43200 |
| | | }); |
| | | if (data.code == 200) { |
| | | this.$store.state.resToken = data.result.token; |
| | | this.resToken = data.result.token; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | //是否为全屏函数 |
| | | onFullscreen(fullscreen) { |
| | | this.isFullscreen = fullscreen; |
| | |
| | | |
| | | }, |
| | | async setEditConfirm() { |
| | | if (this.editData.url.indexOf('?') > -1) { |
| | | var val = this.editData.url.split("?"); |
| | | this.editData.url = val[0]; |
| | | this.editData.args = this.editData.args + val[1]; |
| | | } |
| | | const data = await res_update(this.editData); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | |
| | | .catch(_ => { }); |
| | | }, |
| | | setEmptyData() { |
| | | this.formInline.name = "" |
| | | this.formInline = { |
| | | name: null, |
| | | type: null, |
| | | data: null, |
| | | category: null, |
| | | status: null |
| | | } |
| | | this.setListDataStart() |
| | | }, |
| | | setInsertTableData() { |
| | |
| | | .catch(_ => { }); |
| | | }, |
| | | async setInsertConfirm() { |
| | | if (this.insertData.url.indexOf('?') > -1) { |
| | | var val = this.insertData.url.split("?"); |
| | | this.insertData.url = val[0]; |
| | | this.insertData.args = val[1] + this.insertData.args; |
| | | } |
| | | |
| | | this.insertData.status = parseInt(this.insertData.status) |
| | | const data = await res_insert(this.insertData); |
| | | if (data.code == 200) { |
| | |
| | | }) |
| | | } |
| | | this.dataType = str; |
| | | |
| | | for (var i in serve_type) { |
| | | std.push({ |
| | | value: serve_type[i].value, |
| | | label: serve_type[i].name, |
| | | }) |
| | | } |
| | | this.dataTypes = std; |
| | | }, |
| | | setScopeEdit(row) { |
| | | this.copyData = JSON.parse(JSON.stringify(row)); |
| | |
| | | }, 1000); |
| | | }, |
| | | formatProxy(row, column) { |
| | | var token = getToken() |
| | | var token = this.resToken |
| | | if (row.proxy && row.proxy.indexOf('{token}') > -1) { |
| | | var val = row.proxy.replaceAll('{token}', token) |
| | | return BASE_URL + val |
| | |
| | | } |
| | | }, |
| | | async getResTableData() { |
| | | this.listData.name = this.formInline.name |
| | | this.listData.name = this.formInline.name; |
| | | this.listData.data = this.formInline.data; |
| | | this.listData.type = this.formInline.type; |
| | | this.listData.category = this.formInline.category; |
| | | this.listData.status = this.formInline.status; |
| | | const data = await select_Res_ByPageAndCount(this.listData); |
| | | if (data.code != 200) { |
| | | return this.$message({ |
| | |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.onResize); |
| | | this.getResToken(); |
| | | this.calHeight(); |
| | | this.getPerms(); |
| | | this.setListDataStart(); |
| | | this.optionsStart(); |
| | | |
| | | |
| | | }, |
| | | }; |
| | | </script> |