From f58535aaa15ad6b32db1f5b7845e6b017fe76258 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 21 Jan 2022 08:45:36 +0800
Subject: [PATCH] 活动
---
src/views/medical/medical.vue | 624 ++++++++++++++++++++++++++++---------------------------
1 files changed, 317 insertions(+), 307 deletions(-)
diff --git a/src/views/medical/medical.vue b/src/views/medical/medical.vue
index 2f079a9..88e7440 100644
--- a/src/views/medical/medical.vue
+++ b/src/views/medical/medical.vue
@@ -32,324 +32,334 @@
</template>
<script>
- import {getList, getDetail, add, update, remove} from "@/api/medical/medical";
- import {mapGetters} from "vuex";
- import website from "@/config/website";
+import {getList, getDetail, add, update, remove} from "@/api/medical/medical";
+import {mapGetters} from "vuex";
+import website from "@/config/website";
- export default {
- data() {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {
- height:'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- align: 'center',
- indexLabel: '序号',
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- column: [
- {
- label: "名称",
- prop: "mechanismname",
- search: true,
- rules: [{
- required: true,
- message: "请输入名称",
- trigger: "blur"
- }]
+export default {
+ data() {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
+ },
+ selectionList: [],
+ option: {
+ height: 'auto',
+ calcHeight: 30,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ align: 'center',
+ indexLabel: '序号',
+ viewBtn: true,
+ selection: true,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "名称",
+ prop: "mechanismname",
+ search: true,
+ rules: [{
+ required: true,
+ message: "请输入名称",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: '所属建筑',
+ prop: 'mtype',
+ hide: true,
+ type: 'select',
+ props: {
+ label: 'dictValue',
+ value: 'dictKey'
},
- {
- label: '所属建筑',
- prop: 'mtype',
- hide: true,
- type: 'select',
- props: {
- label: 'dictValue',
- value: 'dictKey'
- },
- dataType: "number",
- cell: true,
- cascaderItem: ['campus', 'loutype'],
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=building",
+ dataType: "number",
+ cell: true,
+ cascaderItem: ['campus', 'loutype'],
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=building",
+ },
+ {
+ label: '所属社区',
+ hide: true,
+ prop: 'campus',
+ type: 'select',
+ dicFlag: false,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=campus",
+ props: {
+ label: 'dictValue',
+ value: 'dictKey'
},
- {
- label: '所属社区',
- hide: true,
- prop: 'campus',
- type: 'select',
- dicFlag: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=campus",
- props: {
- label: 'dictValue',
- value: 'dictKey'
- },
+ },
+ {
+ label: '所属楼',
+ prop: 'loutype',
+ hide: true,
+ type: 'tree',
+ cell: true,
+ props: {
+ label: 'dictValue',
+ value: 'dictKey'
},
- {
- label: '所属楼',
- prop: 'loutype',
- hide: true,
- type: 'tree',
- cell: true,
- props: {
- label: 'dictValue',
- value: 'dictKey'
- },
- dicUrl: "/api/blade-architecture/architecture/selectType?campus={{key}}&type={{mtype}}",
+ dicUrl: "/api/blade-architecture/architecture/selectType?campus={{key}}&type={{mtype}}",
+ },
+ {
+ label: "经度",
+ prop: "jd",
+ rules: [{
+ required: true,
+ message: "请输入经度",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "纬度",
+ prop: "wd",
+ rules: [{
+ required: true,
+ message: "请输入纬度",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "电话",
+ prop: "telephone",
+ },
+ {
+ label: "高度",
+ addDisplay: false,
+ prop: "gd",
+ },
+ {
+ label: "偏航角",
+ addDisplay: false,
+ hide: true,
+ prop: "heading",
+ },
+ {
+ label: "俯仰角",
+ addDisplay: false,
+ hide: true,
+ prop: "pitch",
+ },
+ {
+ label: "翻转角",
+ addDisplay: false,
+ hide: true,
+ prop: "roll",
+ },
+ {
+ label: "网站地址",
+ prop: "websiteurl",
+ },
+ {
+ label: "地址",
+ prop: "address",
+ },
+ {
+ label: "图片",
+ prop: "tpurl",
+ // dataType: 'string',
+ type: "upload",
+ propsHttp: {
+ res: 'data',
+ url: 'link',
},
- {
- label: "经度",
- prop: "jd",
- rules: [{
- required: true,
- message: "请输入经度",
- trigger: "blur"
- }]
+ span: 10,
+ listType: "picture-card",
+ tip: "只能上传jpg/png文件,且不超过500kb",
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ },
+ {
+ label: "二维码",
+ prop: "codeurl",
+ type: 'upload',
+ listType: 'picture-card',
+ //dataType: 'string',
+ action: '/api/blade-resource/oss/endpoint/put-file',
+ propsHttp: {
+ res: 'data',
+ url: 'link',
},
- {
- label: "纬度",
- prop: "wd",
- rules: [{
- required: true,
- message: "请输入纬度",
- trigger: "blur"
- }]
- },
- {
- label: "电话",
- prop: "telephone",
- },
- {
- label: "高度",
- addDisplay: false,
- prop: "gd",
- },
- {
- label: "偏航角",
- addDisplay: false,
- hide: true,
- prop: "heading",
- },
- {
- label: "俯仰角",
- addDisplay: false,
- hide: true,
- prop: "pitch",
- },
- {
- label: "翻转角",
- addDisplay: false,
- hide: true,
- prop: "roll",
- },
- {
- label: "网站地址",
- prop: "websiteurl",
- },
- {
- label: "地址",
- prop: "address",
- },
- {
- label: "图片",
- prop: "tpurl",
- // dataType: 'string',
- type: "upload",
- propsHttp: {
- res: 'data',
- url: 'link',
- },
- span: 10,
- listType: "picture-card",
- tip: "只能上传jpg/png文件,且不超过500kb",
- action: "/api/blade-resource/oss/endpoint/put-file",
- },
- {
- label: "二维码",
- prop: "codeurl",
- type: 'upload',
- listType: 'picture-card',
- //dataType: 'string',
+ span: 10,
+ },
+ {
+ label: "介绍",
+ prop: "introduce",
+ component: 'AvueUeditor',
+ options: {
action: '/api/blade-resource/oss/endpoint/put-file',
- propsHttp: {
- res: 'data',
- url: 'link',
- },
- span: 10,
+ props: {
+ res: "data",
+ url: "link",
+ }
},
- {
- label: "介绍",
- prop: "introduce",
- component: 'AvueUeditor',
- options: {
- action: '/api/blade-resource/oss/endpoint/put-file',
- props: {
- res: "data",
- url: "link",
- }
- },
- hide: true,
- minRows: 5,
- span: 24,
- },
- ]
- },
- data: []
+ hide: true,
+ minRows: 5,
+ span: 24,
+ },
+ ]
+ },
+ data: []
+ };
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.medical_add, false),
+ viewBtn: this.vaildData(this.permission.medical_view, false),
+ delBtn: this.vaildData(this.permission.medical_delete, false),
+ editBtn: this.vaildData(this.permission.medical_edit, false)
};
},
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.medical_add, false),
- viewBtn: this.vaildData(this.permission.medical_view, false),
- delBtn: this.vaildData(this.permission.medical_delete, false),
- editBtn: this.vaildData(this.permission.medical_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- methods: {
- rowSave(row, done, loading) {
- var d = [];
- var dk = [];
- for (var k in row.tpurl) {
- d.push(row.tpurl[k].value);
- }
- for (var ks in row.codeurl) {
- dk.push(row.codeurl[ks].value);
- }
- row.tpurl = d.join(",");
- row.codeurl = dk.join(",");
- add(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- window.console.log(error);
- });
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- console.log(error);
- });
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- beforeOpen(done, type) {
- if (["edit", "view"].includes(type)) {
- getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- });
- }
- done();
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- currentChange(currentPage){
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize){
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
- }
+ ids() {
+ let ids = [];
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
}
- };
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ var d = [];
+ var dk = [];
+ for (var k in row.tpurl) {
+ d.push(row.tpurl[k].value);
+ }
+ for (var ks in row.codeurl) {
+ dk.push(row.codeurl[ks].value);
+ }
+ row.tpurl = d.join(",");
+ row.codeurl = dk.join(",");
+ add(row).then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ loading();
+ window.console.log(error);
+ });
+ },
+ rowUpdate(row, index, done, loading) {
+ var d = [];
+ var dk = [];
+ for (var k in row.tpurl) {
+ d.push(row.tpurl[k].value);
+ }
+ for (var ks in row.codeurl) {
+ dk.push(row.codeurl[ks].value);
+ }
+ row.tpurl = d.join(",");
+ row.codeurl = dk.join(",");
+ update(row).then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ loading();
+ console.log(error);
+ });
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail(this.form.id).then(res => {
+ this.form = res.data.data;
+ });
+ }
+ done();
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ selectionClear() {
+ this.selectionList = [];
+ this.$refs.crud.toggleSelection();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ this.loading = true;
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ }
+ }
+};
</script>
<style>
--
Gitblit v1.9.3