| | |
| | | <template> |
| | | <basic-container |
| | | :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']" |
| | | :class="[ |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | class="tablesss" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | update, |
| | | add, |
| | | setting, |
| | | datasource, |
| | | datasource |
| | | } from "@/api/system/tenant"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | option: { |
| | | height: "auto", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入保安单位ID", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "保安企业名称", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入参数名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "联系人", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入联系人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "contactNumber", |
| | | width: 150, |
| | | width: 150 |
| | | }, |
| | | { |
| | | label: "联系地址", |
| | |
| | | span: 24, |
| | | minRows: 2, |
| | | type: "textarea", |
| | | hide: true, |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "账号额度", |
| | |
| | | width: 90, |
| | | slot: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | editDisplay: false |
| | | }, |
| | | { |
| | | label: "过期时间", |
| | |
| | | width: 180, |
| | | slot: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | editDisplay: false |
| | | }, |
| | | { |
| | | label: "绑定域名", |
| | | prop: "domain", |
| | | span: 24, |
| | | span: 24 |
| | | }, |
| | | { |
| | | label: "系统背景", |
| | |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | url: "link" |
| | | }, |
| | | hide: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | span: 24 |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | settingForm: {}, |
| | |
| | | label: "账号额度", |
| | | prop: "accountNumber", |
| | | type: "number", |
| | | span: 24, |
| | | span: 24 |
| | | }, |
| | | { |
| | | label: "过期时间", |
| | |
| | | type: "date", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | span: 24, |
| | | }, |
| | | ], |
| | | span: 24 |
| | | } |
| | | ] |
| | | }, |
| | | datasourceForm: {}, |
| | | datasourceOption: { |
| | |
| | | dicUrl: "/api/blade-develop/datasource/select", |
| | | props: { |
| | | label: "name", |
| | | value: "id", |
| | | value: "id" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择数据源", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | 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; |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | getDetail(this.form.id).then(res => { |
| | | const data = res.data.data; |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | |
| | | 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; |
| | |
| | | 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.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.box = false; |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.datasourceBox = false; |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |