Commit 24ec6cb4 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 249dfd2c 2af0acbc
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
"highlight.js": "^10.2.1", "highlight.js": "^10.2.1",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"nanoid": "^4.0.0", "nanoid": "^4.0.0",
......
...@@ -3,8 +3,6 @@ import App from "./App.vue"; ...@@ -3,8 +3,6 @@ import App from "./App.vue";
import { initRouter } from "./router"; import { initRouter } from "./router";
import "./theme/index.less"; import "./theme/index.less";
import Antd from "ant-design-vue"; import Antd from "ant-design-vue";
// import Viser from 'viser-vue'
// import '@/mock'
import store from "./store"; import store from "./store";
import "animate.css/source/animate.css"; import "animate.css/source/animate.css";
import "./assets/css/common.less"; import "./assets/css/common.less";
...@@ -48,6 +46,9 @@ Vue.use(Viewer); ...@@ -48,6 +46,9 @@ Vue.use(Viewer);
// moment 时间处理 // moment 时间处理
import moment from "moment"; import moment from "moment";
Vue.prototype.$moment = moment; Vue.prototype.$moment = moment;
// 引入lodash
import lodash from "lodash";
Vue.prototype.$_ = lodash;
// nanoid // nanoid
import { nanoid } from "nanoid"; import { nanoid } from "nanoid";
Vue.prototype.$nanoid = nanoid; Vue.prototype.$nanoid = nanoid;
......
...@@ -201,8 +201,8 @@ export default { ...@@ -201,8 +201,8 @@ export default {
size: -1, size: -1,
siteId: this.siteId, siteId: this.siteId,
}); });
let { data } = res.data.data;
if (res.data.code === 1) { if (res.data.code === 1) {
let { data } = res.data.data;
this.categoryList = data; this.categoryList = data;
} }
}, },
...@@ -287,8 +287,9 @@ export default { ...@@ -287,8 +287,9 @@ export default {
this.siteVisible = true; this.siteVisible = true;
}, },
filterItems(appThemeName) { filterItems(appThemeName) {
if (!appThemeName) return;
let arr = this.categoryList.find((v) => v.id == appThemeName); let arr = this.categoryList.find((v) => v.id == appThemeName);
if (arr.length) { if (arr) {
return arr.categoryName; return arr.categoryName;
} else { } else {
return "--"; return "--";
......
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
<template slot="img" slot-scope="text"> <template slot="img" slot-scope="text">
<img <img
v-if="text.img" v-if="text.img"
width="50" class="pre-item"
:src="api2 + text.img" :src="filterRes(text.img)"
@click="handlePreview('img', api2 + text.img)" @click="handlePreview('img', text.img)"
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
...@@ -76,8 +76,8 @@ ...@@ -76,8 +76,8 @@
<video <video
v-if="text.video" v-if="text.video"
width="50" width="50"
:src="api2 + text.video" :src="filterRes(text.video)"
@click="handlePreview('vidoe', api2 + text.video)" @click="handlePreview('video', api2 + text.video)"
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
return; return;
} }
this.title = "新增"; this.title = "新增";
let arr = JSON.parse(JSON.stringify(this.appTemplate)); let arr = this.$_.cloneDeep(this.appTemplate);
this.$refs.AddData.onAdd(arr); this.$refs.AddData.onAdd(arr);
this.AddVisible = true; this.AddVisible = true;
}, },
...@@ -292,13 +292,30 @@ export default { ...@@ -292,13 +292,30 @@ export default {
}, },
}); });
}, },
// 过滤影音
filterRes(data) {
let resource = data.split(",").map((v) => {
return this.api2 + v;
});
return resource[0];
},
// 预览 // 预览
handlePreview(type, url) { handlePreview(type, data) {
let resource = data.split(",").map((v) => {
return this.api2 + v;
});
if (type == "img") {
this.$viewerApi({
images: resource,
});
} else {
this.previewData = { this.previewData = {
type, type,
url, url: resource[0],
}; };
this.previewVisible = true; this.previewVisible = true;
}
}, },
}, },
}; };
...@@ -311,6 +328,7 @@ export default { ...@@ -311,6 +328,7 @@ export default {
} }
img, img,
video { video {
width: 50px;
cursor: pointer; cursor: pointer;
} }
</style> </style>
\ No newline at end of file
...@@ -47,9 +47,11 @@ ...@@ -47,9 +47,11 @@
<template slot="appIconPath" slot-scope="text"> <template slot="appIconPath" slot-scope="text">
<img <img
v-if="text.appIconPath" v-if="text.appIconPath"
class="pointer"
height="20" height="20"
width="20" width="20"
:src="api2 + text.appIconPath" :src="api2 + text.appIconPath"
@click="handlePreview(api2 + text.appIconPath)"
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
...@@ -378,6 +380,12 @@ export default { ...@@ -378,6 +380,12 @@ export default {
this.categoryList.find((v) => v.id == appThemeName).categoryName || "--" this.categoryList.find((v) => v.id == appThemeName).categoryName || "--"
); );
}, },
// 预览图片
handlePreview(url) {
this.$viewerApi({
images: [url],
});
},
}, },
}; };
</script> </script>
......
...@@ -47,9 +47,11 @@ ...@@ -47,9 +47,11 @@
<template slot="appIconPath" slot-scope="text"> <template slot="appIconPath" slot-scope="text">
<img <img
v-if="text.appIconPath" v-if="text.appIconPath"
class="pointer"
height="20" height="20"
width="20" width="20"
:src="api2 + text.appIconPath" :src="api2 + text.appIconPath"
@click="handlePreview(api2 + text.appIconPath)"
/> />
<span v-else>--</span> <span v-else>--</span>
</template> </template>
...@@ -362,6 +364,12 @@ export default { ...@@ -362,6 +364,12 @@ export default {
this.categoryList.find((v) => v.id == appThemeName).categoryName || "--" this.categoryList.find((v) => v.id == appThemeName).categoryName || "--"
); );
}, },
// 预览图片
handlePreview(url) {
this.$viewerApi({
images: [url],
});
},
}, },
}; };
</script> </script>
......
...@@ -147,11 +147,6 @@ ...@@ -147,11 +147,6 @@
<a-button type="primary" @click="onSubmit"> 确定 </a-button> <a-button type="primary" @click="onSubmit"> 确定 </a-button>
</a-space> </a-space>
</div> </div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-drawer> </a-drawer>
</div> </div>
</template> </template>
...@@ -162,11 +157,9 @@ import { saveApp } from "@/services/market"; ...@@ -162,11 +157,9 @@ import { saveApp } from "@/services/market";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { changeCodeNumber } from "@/utils/validate"; import { changeCodeNumber } from "@/utils/validate";
// import local from "@/utils/local"; // import local from "@/utils/local";
import PrevieModal from "@/components/PrevieModal.vue";
export default { export default {
components: { components: {
YSwitch, YSwitch,
PrevieModal,
}, },
props: { props: {
title: { title: {
...@@ -190,8 +183,6 @@ export default { ...@@ -190,8 +183,6 @@ export default {
accept: "image/jpeg,image/png,image/svg+xml", accept: "image/jpeg,image/png,image/svg+xml",
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL, api2: process.env.VUE_APP_API_IMG_URL,
previewData: {}, // 预览
previewVisible: false,
iconFileList: [], iconFileList: [],
labelCol: { labelCol: {
span: 3, span: 3,
...@@ -336,11 +327,9 @@ export default { ...@@ -336,11 +327,9 @@ export default {
}, },
// 预览 // 预览
handlePreview(info) { handlePreview(info) {
this.previewData = { this.$viewerApi({
type: "img", images: [info.url],
url: info.url, });
};
this.previewVisible = true;
}, },
// 上传应用 // 上传应用
handleChangeFile(info) { handleChangeFile(info) {
......
...@@ -127,8 +127,8 @@ ...@@ -127,8 +127,8 @@
<!-- 文件上传 --> <!-- 文件上传 -->
<a-upload <a-upload
v-else-if="v.fieldType == 'upload'" v-else-if="v.fieldType == 'upload'"
:action="api + 'base/file/commonupload'" :action="api + '/base/file/commonupload'"
:multiple="false" :multiple="true"
:file-list="v.fileList" :file-list="v.fileList"
@change=" @change="
(info) => { (info) => {
...@@ -158,8 +158,15 @@ ...@@ -158,8 +158,15 @@
:columns="columns" :columns="columns"
:data-source="tableList" :data-source="tableList"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedLeftRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectChange, onChange: (keys, rows) => {
onSelectChange(
keys,
rows,
v,
`appInfoFieldList.${i}.fieldValue`
);
},
}" }"
@change="changeTable" @change="changeTable"
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
...@@ -187,7 +194,9 @@ ...@@ -187,7 +194,9 @@
> >
<a-space size="middle"> <a-space size="middle">
<a-button @click="onClose"> 取消 </a-button> <a-button @click="onClose"> 取消 </a-button>
<a-button type="primary" @click="onSubmit"> 保存 </a-button> <a-button :loading="loading" type="primary" @click="onSubmit">
保存
</a-button>
</a-space> </a-space>
</div> </div>
</a-drawer> </a-drawer>
...@@ -196,7 +205,7 @@ ...@@ -196,7 +205,7 @@
<script> <script>
import YQuillEditor from "@/components/YQuillEditor.vue"; import YQuillEditor from "@/components/YQuillEditor.vue";
import { saveDataset } from "@/services/market"; import { batchSaveDataset } from "@/services/market";
import { request } from "@/utils/request"; import { request } from "@/utils/request";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
...@@ -217,14 +226,15 @@ export default { ...@@ -217,14 +226,15 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
siteId: local.getLocal("siteId"), siteId: local.getLocal("siteId"),
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL,
pageSizeOptions: ["10", "30", "50", "100", "200"], pageSizeOptions: ["10", "30", "50", "100", "200"],
labelCol: { labelCol: {
span: 2, span: 3,
}, },
wrapperCol: { wrapperCol: {
span: 22, span: 21,
}, },
form: { form: {
appId: "", appId: "",
...@@ -232,12 +242,15 @@ export default { ...@@ -232,12 +242,15 @@ export default {
}, },
isopen: false, isopen: false,
year: null, year: null,
selectedLeftRowKeys: [], selectedRowKeys: [],
selectedRow: [],
current: 1, current: 1,
size: 10, size: 10,
total: 0, total: 0,
tableList: [], tableList: [],
columns: [], columns: [],
serviceApi: "",
serviceApiParams: {},
}; };
}, },
computed: { computed: {
...@@ -260,8 +273,30 @@ export default { ...@@ -260,8 +273,30 @@ export default {
async onSubmit() { async onSubmit() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
let res = await saveDataset(this.form); this.loading = true;
let arr = [];
if (this.selectedRow.length) {
arr = this.selectedRow.map((v) => {
return {
appId: this.form.appId,
appInfoFieldList: this.$_.cloneDeep(
this.form.appInfoFieldList.map((item) => {
Object.keys(this.serviceApiParams).forEach((key) => {
if (item.fieldCode == key) {
item.fieldValue = v[this.serviceApiParams[key]];
}
});
return item;
})
),
};
});
} else {
arr = [this.form];
}
let res = await batchSaveDataset(arr);
let { code, msg } = res.data; let { code, msg } = res.data;
this.loading = false;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.$emit("addSuccess"); this.$emit("addSuccess");
...@@ -276,7 +311,7 @@ export default { ...@@ -276,7 +311,7 @@ export default {
onAdd(appTemplate) { onAdd(appTemplate) {
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id"); this.form.id && this.$delete(this.form, "id");
this.form.appInfoFieldList = appTemplate.map(async (v) => { this.form.appInfoFieldList = appTemplate.map((v) => {
if (v.id) { if (v.id) {
delete v.id; delete v.id;
} }
...@@ -288,7 +323,24 @@ export default { ...@@ -288,7 +323,24 @@ export default {
v.checkbox = []; v.checkbox = [];
} }
if (v.fieldType == "table") { if (v.fieldType == "table") {
await this.getData(v.serviceApi); let index = {
title: "序号",
width: "65px",
scopedSlots: {
customRender: "num",
},
};
let fieldTypeValue = JSON.parse(v.fieldTypeValue);
fieldTypeValue = Object.keys(fieldTypeValue).map((key) => {
return {
title: fieldTypeValue[key],
dataIndex: key,
};
});
this.columns = [index, ...fieldTypeValue];
this.serviceApi = v.serviceApi;
this.serviceApiParams = JSON.parse(v.serviceApiParams);
this.getData();
} }
return v; return v;
}); });
...@@ -299,14 +351,15 @@ export default { ...@@ -299,14 +351,15 @@ export default {
data.appInfoFieldList.forEach((v) => { data.appInfoFieldList.forEach((v) => {
if (v.fieldType == "upload") { if (v.fieldType == "upload") {
if (v.fieldValue) { if (v.fieldValue) {
v.fileList = [ let arr = v.fieldValue.split(",");
{ v.fileList = arr.map((v, i) => {
uid: v.id, return {
name: v.fieldValue, uid: i,
name: v,
status: "done", status: "done",
url: v.fieldValue, url: v,
}, };
]; });
} else { } else {
v.fileList = []; v.fileList = [];
} }
...@@ -323,11 +376,11 @@ export default { ...@@ -323,11 +376,11 @@ export default {
// 文件上传 // 文件上传
handleChange(info, row) { handleChange(info, row) {
let fileList = [...info.fileList]; let fileList = [...info.fileList];
fileList = fileList.slice(-1); // fileList = fileList.slice(-1);
fileList = fileList.map((file) => { fileList = fileList.map((file) => {
if (file.response) { if (!file.url && file.response) {
file.url = file.response.url; file.url = file.response.url;
} else { } else if (!file.url && !file.response) {
file.url = ""; file.url = "";
} }
return file; return file;
...@@ -351,22 +404,67 @@ export default { ...@@ -351,22 +404,67 @@ export default {
row.fieldValue = this.$moment(value).format("YYYY"); row.fieldValue = this.$moment(value).format("YYYY");
this.isopen = false; this.isopen = false;
}, },
onSelectChange(keys, rows) { onSelectChange(keys, rows, data, prop) {
this.selectedLeftRowKeys = keys; this.selectedRowKeys = keys;
console.log(rows); const res = new Map();
this.selectedRow = [...this.selectedRow, ...rows]
.filter((v) => {
return !res.has(v.id) && res.set(v.id, 1);
})
.filter((v) => {
return this.selectedRowKeys.some((val) => v.id == val);
});
data.fieldValue = keys.join(",");
for (let item of this.form.appInfoFieldList) {
Object.keys(this.serviceApiParams).forEach((key) => {
if (item.fieldCode == key) {
item.fieldValue = this.selectedRow.length
? this.selectedRow[0][this.serviceApiParams[key]]
: "";
if (item.fieldType == "upload") {
if (this.selectedRow.length) {
item.fileList = [
...item.fileList,
{
uid: -1,
name: this.selectedRow[0][this.serviceApiParams[key]],
status: "done",
url: this.selectedRow[0][this.serviceApiParams[key]],
},
].filter((v) => {
return !res.has(v.uuid) && res.set(v.uuid, 1);
});
} else {
item.fileList = item.fileList.filter((v) => v.uid != -1);
}
}
}
});
}
this.$refs.form.validateField(prop);
}, },
// 获取数据函数 // 获取数据函数
async getData(url, data) { async getData(data) {
let res = await request(this.api + url, "post", { let res = await request(this.api + this.serviceApi, "post", {
size: this.size, size: this.size,
page: this.current, page: this.current,
siteId: this.siteId, siteId: this.siteId,
...data, ...data,
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
console.log(res.data.data); let { data, total } = res.data.data;
this.tableList = data;
this.total = total;
} }
}, },
changeTable(info) {
let { current, pageSize } = info;
this.current = current;
this.size = pageSize;
this.getData();
},
}, },
}; };
</script> </script>
...@@ -374,7 +472,7 @@ export default { ...@@ -374,7 +472,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
/deep/.ant-form-item { /deep/.ant-form-item {
display: flex; display: flex;
align-items: center; align-items: flex-start;
} }
/deep/.ant-drawer-body { /deep/.ant-drawer-body {
height: calc(100vh - 55px); height: calc(100vh - 55px);
...@@ -398,4 +496,9 @@ export default { ...@@ -398,4 +496,9 @@ export default {
.upload-item { .upload-item {
display: block !important; display: block !important;
} }
// .ant-input,
// .ant-select,
// .ant-calendar-picker {
// width: 40%;
// }
</style> </style>
\ No newline at end of file
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
> >
<a-input <a-input
v-model="form.serviceApi" v-model="form.serviceApi"
placeholder="请输入接口地址,示例:/app/dataset/save" placeholder="请输入接口地址,示例:/base/app/dataset/save"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
...@@ -85,14 +85,14 @@ ...@@ -85,14 +85,14 @@
<a-space> <a-space>
<div> <div>
<a-space> <a-space>
<span>键名</span> <span>编码</span>
<a-input v-model="v.key" placeholder="请输入键名" /> <a-input v-model="v.key" placeholder="请输入字段编码" />
</a-space> </a-space>
</div> </div>
<div> <div>
<a-space> <a-space>
<span>映射:</span> <span>映射:</span>
<a-input v-model="v.value" placeholder="请输入映射字段编码" /> <a-input v-model="v.value" placeholder="请输入映射字段" />
</a-space> </a-space>
</div> </div>
<a-button type="primary" @click="insertion(i, 'params')" <a-button type="primary" @click="insertion(i, 'params')"
...@@ -309,10 +309,22 @@ export default { ...@@ -309,10 +309,22 @@ export default {
handleOk() { handleOk() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
let fieldTypeObj = {};
let apiParamsObj = {};
this.fieldType.forEach((v) => {
if (v.key && v.value) {
fieldTypeObj[v.key] = v.value;
}
});
this.apiParams.forEach((v) => {
if (v.key && v.value) {
apiParamsObj[v.key] = v.value;
}
});
let res = await saveTemplete({ let res = await saveTemplete({
...this.form, ...this.form,
fieldTypeValue: JSON.stringify(this.fieldType), fieldTypeValue: fieldTypeObj ? JSON.stringify(fieldTypeObj) : "",
serviceApiParams: JSON.stringify(this.apiParams), serviceApiParams: apiParamsObj ? JSON.stringify(apiParamsObj) : "",
}); });
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
...@@ -348,7 +360,13 @@ export default { ...@@ -348,7 +360,13 @@ export default {
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
if (data.fieldTypeValue) { if (data.fieldTypeValue) {
this.fieldType = JSON.parse(data.fieldTypeValue); let fieldTypeObj = JSON.parse(data.fieldTypeValue);
this.fieldType = Object.keys(fieldTypeObj).map((key) => {
return {
key,
value: fieldTypeObj[key],
};
});
} else { } else {
this.fieldType = [ this.fieldType = [
{ {
...@@ -358,7 +376,13 @@ export default { ...@@ -358,7 +376,13 @@ export default {
]; ];
} }
if (data.serviceApiParams) { if (data.serviceApiParams) {
this.apiParams = JSON.parse(data.serviceApiParams); let apiParamsObj = JSON.parse(data.serviceApiParams);
this.apiParams = Object.keys(apiParamsObj).map((key) => {
return {
key,
value: apiParamsObj[key],
};
});
} else { } else {
this.apiParams = [ this.apiParams = [
{ {
......
...@@ -60,7 +60,13 @@ ...@@ -60,7 +60,13 @@
<img width="30" height="30" :src="api2 + text.modelIcon" /> <img width="30" height="30" :src="api2 + text.modelIcon" />
</div> --> </div> -->
<div class="svg-box"> <div class="svg-box">
<img width="30" height="30" :src="api2 + text.modelIcon" /> <img
class="pointer"
width="30"
height="30"
:src="api2 + text.modelIcon"
@click="handlePreview({ url: api2 + text.modelIcon })"
/>
</div> </div>
</div> </div>
<span v-else>--</span> <span v-else>--</span>
...@@ -220,11 +226,6 @@ ...@@ -220,11 +226,6 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-modal> </a-modal>
<!-- 报表管理 --> <!-- 报表管理 -->
<StatementManage <StatementManage
...@@ -236,7 +237,6 @@ ...@@ -236,7 +237,6 @@
<script> <script>
import { modelList, addMode, delMode } from "@/services/basicsetFun"; import { modelList, addMode, delMode } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue";
import StatementManage from "./components/StatementManage.vue"; import StatementManage from "./components/StatementManage.vue";
import TabHeader from "@/components/TabHeader"; import TabHeader from "@/components/TabHeader";
import { pageSizeOptions } from "@/config/pageConfig.js"; import { pageSizeOptions } from "@/config/pageConfig.js";
...@@ -294,7 +294,6 @@ const columns = [ ...@@ -294,7 +294,6 @@ const columns = [
]; ];
export default { export default {
components: { components: {
PrevieModal,
StatementManage, StatementManage,
TabHeader, TabHeader,
}, },
...@@ -304,8 +303,6 @@ export default { ...@@ -304,8 +303,6 @@ export default {
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL, api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png,image/svg+xml", // 上传类型 accept: "image/jpeg,image/png,image/svg+xml", // 上传类型
previewData: {}, // 预览
previewVisible: false,
columns, columns,
loading: true, loading: true,
title: "新增模块", title: "新增模块",
...@@ -502,11 +499,9 @@ export default { ...@@ -502,11 +499,9 @@ export default {
}, },
// 预览 // 预览
handlePreview(info) { handlePreview(info) {
this.previewData = { this.$viewerApi({
type: "img", images: [info.url],
url: info.url, });
};
this.previewVisible = true;
}, },
// 关闭对话框 // 关闭对话框
......
...@@ -299,11 +299,6 @@ ...@@ -299,11 +299,6 @@
</a-form-model> </a-form-model>
</div> </div>
</a-modal> </a-modal>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -312,7 +307,6 @@ import YCheckbox from "@/components/ycheckbox/YCheckbox.vue"; ...@@ -312,7 +307,6 @@ import YCheckbox from "@/components/ycheckbox/YCheckbox.vue";
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
// import options from "@/utils/city"; // import options from "@/utils/city";
import { regionData } from "element-china-area-data"; import { regionData } from "element-china-area-data";
import PrevieModal from "@/components/PrevieModal.vue";
export default { export default {
props: { props: {
formVisible: { formVisible: {
...@@ -326,7 +320,6 @@ export default { ...@@ -326,7 +320,6 @@ export default {
}, },
components: { components: {
YCheckbox, YCheckbox,
PrevieModal,
YSwitch, YSwitch,
}, },
data() { data() {
...@@ -356,8 +349,6 @@ export default { ...@@ -356,8 +349,6 @@ export default {
api2: process.env.VUE_APP_API_IMG_URL, api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型 accept: "image/jpeg,image/png", // 上传类型
loading: false, loading: false,
previewData: {}, // 预览logo信息
previewVisible: false,
options: regionData, // 地区级联数据 options: regionData, // 地区级联数据
tablename: "", //接口名称 tablename: "", //接口名称
modelIds: [], // 板块数据 modelIds: [], // 板块数据
...@@ -711,11 +702,9 @@ export default { ...@@ -711,11 +702,9 @@ export default {
}, },
// 预览logo // 预览logo
handlePreview(info) { handlePreview(info) {
this.previewData = { this.$viewerApi({
type: "img", images: [info.url],
url: info.url, });
};
this.previewVisible = true;
}, },
// 删除logo // 删除logo
// handleRemove() { // handleRemove() {
......
...@@ -334,18 +334,12 @@ ...@@ -334,18 +334,12 @@
<a-button @click="handleReset">重置</a-button> <a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="hideModal">确定</a-button> <a-button type="primary" @click="hideModal">确定</a-button>
</div> </div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import { getWindowList, saveWorkman } from "@/services/dept"; import { getWindowList, saveWorkman } from "@/services/dept";
import { modelList } from "@/services/basicsetFun"; import { modelList } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue";
// import { changePhone, changeLandline } from "@/utils/validate"; // import { changePhone, changeLandline } from "@/utils/validate";
export default { export default {
props: { props: {
...@@ -374,9 +368,7 @@ export default { ...@@ -374,9 +368,7 @@ export default {
}, },
}, },
}, },
components: { components: {},
PrevieModal,
},
data() { data() {
const checkIdCard = (rule, value, callback) => { const checkIdCard = (rule, value, callback) => {
if (!value) { if (!value) {
...@@ -395,8 +387,6 @@ export default { ...@@ -395,8 +387,6 @@ export default {
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL, api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型 accept: "image/jpeg,image/png", // 上传类型
previewData: {}, // 预览
previewVisible: false,
fileList: [], fileList: [],
loading: false, loading: false,
imageUrl: "", imageUrl: "",
...@@ -586,11 +576,9 @@ export default { ...@@ -586,11 +576,9 @@ export default {
}, },
// 预览 // 预览
handlePreview(info) { handlePreview(info) {
this.previewData = { this.$viewerApi({
type: "img", images: [info.url],
url: info.url, });
};
this.previewVisible = true;
}, },
// 照片大小格式限制 // 照片大小格式限制
beforeUpload(file) { beforeUpload(file) {
......
...@@ -366,11 +366,6 @@ ...@@ -366,11 +366,6 @@
<a-button @click="handleReset">重置</a-button> <a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="hideModal">确定</a-button> <a-button type="primary" @click="hideModal">确定</a-button>
</div> </div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-modal> </a-modal>
</template> </template>
...@@ -378,7 +373,6 @@ ...@@ -378,7 +373,6 @@
import { changeAccount, changePassWord } from "@/utils/validate"; import { changeAccount, changePassWord } from "@/utils/validate";
import { getWindowList, saveWorkman } from "@/services/dept"; import { getWindowList, saveWorkman } from "@/services/dept";
import { modelList } from "@/services/basicsetFun"; import { modelList } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue";
// import { changePhone, changeLandline } from "@/utils/validate"; // import { changePhone, changeLandline } from "@/utils/validate";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
...@@ -408,9 +402,7 @@ export default { ...@@ -408,9 +402,7 @@ export default {
}, },
}, },
}, },
components: { components: {},
PrevieModal,
},
data() { data() {
const checkIdCard = (rule, value, callback) => { const checkIdCard = (rule, value, callback) => {
if (!value) { if (!value) {
...@@ -429,8 +421,6 @@ export default { ...@@ -429,8 +421,6 @@ export default {
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL, api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型 accept: "image/jpeg,image/png", // 上传类型
previewData: {}, // 预览
previewVisible: false,
fileList: [], fileList: [],
loading: false, loading: false,
imageUrl: "", imageUrl: "",
...@@ -626,11 +616,9 @@ export default { ...@@ -626,11 +616,9 @@ export default {
}, },
// 预览 // 预览
handlePreview(info) { handlePreview(info) {
this.previewData = { this.$viewerApi({
type: "img", images: [info.url],
url: info.url, });
};
this.previewVisible = true;
}, },
// 照片大小格式限制 // 照片大小格式限制
beforeUpload(file) { beforeUpload(file) {
......
...@@ -219,6 +219,7 @@ ...@@ -219,6 +219,7 @@
<img <img
v-if="text.photoPath" v-if="text.photoPath"
:src="api2 + text.photoPath" :src="api2 + text.photoPath"
@click="handlePreview(api2 + text.photoPath)"
class="pht" class="pht"
/> />
...@@ -651,6 +652,12 @@ export default { ...@@ -651,6 +652,12 @@ export default {
} }
return fromnum; return fromnum;
}, },
// 预览照片
handlePreview(url) {
this.$viewerApi({
images: [url],
});
},
}, },
}; };
</script> </script>
...@@ -690,6 +697,7 @@ export default { ...@@ -690,6 +697,7 @@ export default {
width: 56px; width: 56px;
height: 74px; height: 74px;
object-fit: cover; object-fit: cover;
cursor: pointer;
} }
div.person_gruop1 { div.person_gruop1 {
......
...@@ -294,6 +294,7 @@ module.exports = { ...@@ -294,6 +294,7 @@ module.exports = {
list: `${BASE_URL}/base/app/dataset/list`, list: `${BASE_URL}/base/app/dataset/list`,
info: `${BASE_URL}/base/app/dataset/info`, info: `${BASE_URL}/base/app/dataset/info`,
save: `${BASE_URL}/base/app/dataset/save`, save: `${BASE_URL}/base/app/dataset/save`,
batchSave: `${BASE_URL}/base/app/dataset/batchSave`,
delete: `${BASE_URL}/base/app/dataset/delete`, delete: `${BASE_URL}/base/app/dataset/delete`,
}, },
// 应用信息字段配置 // 应用信息字段配置
......
...@@ -61,6 +61,10 @@ export async function getDatasetInfo(data) { ...@@ -61,6 +61,10 @@ export async function getDatasetInfo(data) {
export async function saveDataset(data) { export async function saveDataset(data) {
return request(dataset.save, METHOD.POST, data); return request(dataset.save, METHOD.POST, data);
} }
// 批量保存数据
export async function batchSaveDataset(data) {
return request(dataset.batchSave, METHOD.POST, data);
}
// 删除数据 // 删除数据
export async function deleteDataset(data) { export async function deleteDataset(data) {
return request(dataset.delete, METHOD.GET, data); return request(dataset.delete, METHOD.GET, data);
......
...@@ -7220,6 +7220,11 @@ lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17 ...@@ -7220,6 +7220,11 @@ lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
log-symbols@^2.2.0: log-symbols@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.npm.taobao.org/log-symbols/download/log-symbols-2.2.0.tgz?cache=0&sync_timestamp=1587898912367&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flog-symbols%2Fdownload%2Flog-symbols-2.2.0.tgz" resolved "https://registry.npm.taobao.org/log-symbols/download/log-symbols-2.2.0.tgz?cache=0&sync_timestamp=1587898912367&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flog-symbols%2Fdownload%2Flog-symbols-2.2.0.tgz"
...@@ -11004,7 +11009,7 @@ uuid@^8.3.2: ...@@ -11004,7 +11009,7 @@ uuid@^8.3.2:
v-viewer@^1.6.4: v-viewer@^1.6.4:
version "1.6.4" version "1.6.4"
resolved "https://registry.npmmirror.com/v-viewer/-/v-viewer-1.6.4.tgz" resolved "https://registry.npmmirror.com/v-viewer/-/v-viewer-1.6.4.tgz#39e36b534baab34076fb816704c6a734de0dc72f"
integrity sha512-LVkiUHpmsbsZXebeNXnu8krRCi5i2n07FeLFxoIVGhw8lVvTBO0ffpbDC6mLEuacCjrIh09HjIqpciwUtWE8lQ== integrity sha512-LVkiUHpmsbsZXebeNXnu8krRCi5i2n07FeLFxoIVGhw8lVvTBO0ffpbDC6mLEuacCjrIh09HjIqpciwUtWE8lQ==
dependencies: dependencies:
throttle-debounce "^2.0.1" throttle-debounce "^2.0.1"
......
...@@ -115,8 +115,8 @@ export default { ...@@ -115,8 +115,8 @@ export default {
opacity: 0, opacity: 0,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("Title"), z: 10,
y: this.getDomTranY("Title"), ...this.getDomTran("Title"),
}, },
"<" "<"
) )
...@@ -126,8 +126,8 @@ export default { ...@@ -126,8 +126,8 @@ export default {
opacity: 0, opacity: 0,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("des"), z: 10,
y: this.getDomTranY("des"), ...this.getDomTran("des"),
}, },
"<" "<"
) )
...@@ -137,8 +137,8 @@ export default { ...@@ -137,8 +137,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item0"), z: 10,
y: this.getDomTranY("item0"), ...this.getDomTran("item0"),
}, },
"<" "<"
) )
...@@ -148,8 +148,8 @@ export default { ...@@ -148,8 +148,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item1"), z: 10,
y: this.getDomTranY("item1"), ...this.getDomTran("item1"),
}, },
"<" "<"
) )
...@@ -159,8 +159,8 @@ export default { ...@@ -159,8 +159,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item2"), z: 10,
y: this.getDomTranY("item2"), ...this.getDomTran("item2"),
}, },
"<" "<"
) )
...@@ -170,8 +170,8 @@ export default { ...@@ -170,8 +170,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item3"), z: 10,
y: this.getDomTranY("item3"), ...this.getDomTran("item3"),
}, },
"<" "<"
) )
...@@ -181,8 +181,8 @@ export default { ...@@ -181,8 +181,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item4"), z: 10,
y: this.getDomTranY("item4"), ...this.getDomTran("item4"),
}, },
"<" "<"
) )
...@@ -192,8 +192,8 @@ export default { ...@@ -192,8 +192,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item5"), z: 10,
y: this.getDomTranY("item5"), ...this.getDomTran("item5"),
}, },
"<" "<"
) )
...@@ -203,8 +203,8 @@ export default { ...@@ -203,8 +203,8 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item6"), z: 10,
y: this.getDomTranY("item6"), ...this.getDomTran("item6"),
}, },
"<" "<"
) )
...@@ -214,24 +214,25 @@ export default { ...@@ -214,24 +214,25 @@ export default {
opacity: 0.7, opacity: 0.7,
scale: 0, scale: 0,
duration: 2, duration: 2,
x: this.getDomTranX("item7"), z: 10,
y: this.getDomTranY("item7"), ...this.getDomTran("item7"),
}, },
"<" "<"
) )
.to(
".menu-box",
{
background: "rgba(5, 30, 75, 0.66)",
},
">"
)
.from( .from(
".name", ".name",
{ {
duration: 2,
opacity: 0, opacity: 0,
}, },
">" "> -1"
)
.to(
".menu-box",
{
background: "rgba(5, 30, 75, 0.66)",
},
"> -1"
); );
}); });
}, },
...@@ -241,7 +242,7 @@ export default { ...@@ -241,7 +242,7 @@ export default {
this.$router.push(url); this.$router.push(url);
}, },
// 获取dom动画偏移 // 获取dom动画偏移
getDomTranX(ref) { getDomTran(ref) {
let dom; let dom;
if (this.$refs[ref] && Array.isArray(this.$refs[ref])) { if (this.$refs[ref] && Array.isArray(this.$refs[ref])) {
dom = this.$refs[ref][0].getBoundingClientRect(); dom = this.$refs[ref][0].getBoundingClientRect();
...@@ -251,18 +252,11 @@ export default { ...@@ -251,18 +252,11 @@ export default {
let menuBox = this.$refs.menuBox.getBoundingClientRect(); let menuBox = this.$refs.menuBox.getBoundingClientRect();
let x = menuBox.left + menuBox.width / 2 - dom.left - dom.width / 2; let x = menuBox.left + menuBox.width / 2 - dom.left - dom.width / 2;
return x;
},
getDomTranY(ref) {
let dom;
if (this.$refs[ref] && Array.isArray(this.$refs[ref])) {
dom = this.$refs[ref][0].getBoundingClientRect();
} else {
dom = this.$refs[ref].getBoundingClientRect();
}
let menuBox = this.$refs.menuBox.getBoundingClientRect();
let y = menuBox.top + menuBox.height / 2 - dom.top - dom.height / 2; let y = menuBox.top + menuBox.height / 2 - dom.top - dom.height / 2;
return y; return {
x,
y,
};
}, },
}, },
beforeDestroy() {}, beforeDestroy() {},
...@@ -279,6 +273,8 @@ export default { ...@@ -279,6 +273,8 @@ export default {
padding-top: @headerH; padding-top: @headerH;
color: #ffffff; color: #ffffff;
position: relative; position: relative;
transform-style: preserve-3d;
perspective: 500px;
// background-color: #000; // background-color: #000;
.wavy { .wavy {
position: absolute; position: absolute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment