Browse Source

Merge branch 'dev-ai' into test

shibei_master
dai 3 years ago
parent
commit
676b7e657d
  1. 4
      src/App.vue
  2. 8
      src/assets/scss/main-shuju.scss
  3. 53
      src/router/index.js
  4. 8
      src/views/components/CTable.vue
  5. 142
      src/views/main-shuju/main-content.vue
  6. 2
      src/views/modules/base/resi.vue
  7. 1
      src/views/modules/communityParty/elegant/index.vue
  8. 4
      src/views/modules/communityService/measure/index.vue
  9. 1
      src/views/modules/communityService/sqzzz/index.vue
  10. 9
      src/views/modules/workPc/guidance/guidanceList.vue
  11. 2
      src/views/modules/workSys/resiCate.vue

4
src/App.vue

@ -133,11 +133,11 @@ export default {
.dialog-h { .dialog-h {
.el-dialog__body { .el-dialog__body {
position: relative; position: relative;
height: 82vh; max-height: 82vh;
box-sizing: border-box; box-sizing: border-box;
padding: 0 10px 20px !important; padding: 0 10px 20px !important;
.dialog-h-content { .dialog-h-content {
height: calc(82vh - 80px); max-height: calc(82vh - 80px);
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
} }

8
src/assets/scss/main-shuju.scss

@ -5,6 +5,14 @@
body { body {
} }
.m-iframe {
position: relative;
width: 100vw;
height: calc(100vh - 55px);
margin: -10px;
z-index: 100;
}
/* Reset element-ui /* Reset element-ui
------------------------------ */ ------------------------------ */
.g-bd { .g-bd {

53
src/router/index.js

@ -298,11 +298,13 @@ router.beforeEach((to, from, next) => {
// url: "visual/basicinfo/basicInfoMain", // url: "visual/basicinfo/basicInfoMain",
children: [ children: [
{ {
url: "/visual/ai/index", url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/monitor-panel",
// url: "/visual/ai/index",
name: "AI安防", name: "AI安防",
id: "5feawfwa111111efwa57", id: "5feawfwa111111efwa57",
}, },
{ {
// url: "http://www.baidu.com",
url: "/visual/ai/renliu", url: "/visual/ai/renliu",
name: "人流数据", name: "人流数据",
id: "5fwaefwae222112fawef58", id: "5fwaefwae222112fawef58",
@ -323,7 +325,8 @@ router.beforeEach((to, from, next) => {
id: "fewafwafewaefddd", id: "fewafwafewaefddd",
}, },
{ {
url: "/visual/ai/yujing", // url: "/visual/ai/yujing",
url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/data-analysis",
name: "预警事件", name: "预警事件",
id: "545345fdsfs", id: "545345fdsfs",
}, },
@ -402,8 +405,21 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
eval(s2) eval(s2)
); // URL支持{{ window.xxx }}占位符变量 ); // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) { if (isURL(URL)) {
route["path"] = route["name"] = `i-${menuList[i].id}`; if (menuList[i].children && menuList[i].children.length >= 1) {
route["meta"]["iframeURL"] = URL; let item = menuList[i].children.find(
(subMenu) => subMenu.url == menuList[i].url
);
if (item) {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["redirect"] = `i-${item.id}`;
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else { } else {
URL = URL.replace(/^\//, "").replace(/_/g, "-"); URL = URL.replace(/^\//, "").replace(/_/g, "-");
if (URL.startsWith("unopen")) { if (URL.startsWith("unopen")) {
@ -464,12 +480,33 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
eval(s2) eval(s2)
); // URL支持{{ window.xxx }}占位符变量 ); // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) { if (isURL(URL)) {
route["path"] = route["name"] = `i-${menuList[i].id}`; if (menuList[i].children && menuList[i].children.length >= 1) {
route["meta"]["iframeURL"] = URL; let item = menuList[i].children.find(
(subMenu) => subMenu.url == menuList[i].url
);
if (item) {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["redirect"] = `i-${item.id}`;
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else { } else {
URL = URL.replace(/^\//, "").replace(/_/g, "-"); URL = URL.replace(/^\//, "").replace(/_/g, "-");
route["path"] = route["name"] = URL.replace(/\//g, "-"); if (URL.startsWith("unopen")) {
route["component"] = () => import(`@/views/modules/${URL}`); route["path"] = route["name"] = URL.replace(/\//g, "-");
route["component"] = () => import(`@/views/modules/unopen`);
} else if (menuList[i].children && menuList[i].children.length >= 1) {
route["path"] = route["name"] = URL;
route["redirect"] = URL.replace(/\//g, "-");
} else {
route["path"] = route["name"] = URL.replace(/\//g, "-");
route["component"] = () => import(`@/views/modules/${URL}`);
}
} }
routes.push(route); routes.push(route);
} }

8
src/views/components/CTable.vue

@ -93,10 +93,10 @@
<el-button v-for="item in operations" <el-button v-for="item in operations"
v-show="item.isShow(scope.row)" v-show="item.isShow(scope.row)"
:key="item.lable" :key="item.lable"
:style=item.style :type="item.type"
:type=item.type :style="item.style"
:size=item.size :size="item.size"
:plain=item.plain :class="item.class"
@click.stop="handleMethod(scope.$index, scope.row,item.methodName)">{{item.lable}}</el-button> @click.stop="handleMethod(scope.$index, scope.row,item.methodName)">{{item.lable}}</el-button>
</template> </template>
</el-table-column> </el-table-column>

142
src/views/main-shuju/main-content.vue

@ -1,98 +1,126 @@
<template> <template>
<main :class="['aui-content']"> <main :class="['aui-content']">
<!-- 其他方式, 展示内容 --> <!-- tab展示内容 -->
<template> <template>
<keep-alive> <template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view /> <iframe
:src="
$router.currentRoute.meta.iframeURL +
'?token=' +
token +
'&customerId=' +
customerId
"
ref="iframe"
class="m-iframe"
id="iframe"
width="100%"
height="100%"
frameborder="0"
scrolling="yes"
/>
</template>
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view @changeCustomerName="changeCustomerName" />
</keep-alive> </keep-alive>
</template> </template>
</main> </main>
</template> </template>
<script> <script>
import { isURL } from '@/utils/validate' import { isURL } from "@/utils/validate";
import Cookie from 'js-cookie' import Cookie from "js-cookie";
export default { export default {
data () { data() {
return { return {
iframeUrl: '', iframeUrl: "",
token: '', token: "",
customerId: '' customerId: "",
} };
}, },
created () { watch: {
// this.$nextTick(() => { // "$router.currentRoute.name": function () {
// this.sendMessage() // console.log($router.currentRoute);
// }) // },
this.token = localStorage.getItem('token') },
this.customerId = localStorage.getItem('customerId') created() {
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
}, },
methods: { methods: {
changeCustomerName (customerName) { changeCustomerName(customerName) {
this.$emit('changeCustomerName', customerName) this.$emit("changeCustomerName", customerName);
}, },
// tabs, iframe // tabs, iframe
tabIsIframe (url) { tabIsIframe(url) {
// this.appendIframe(url) // this.appendIframe(url)
this.iframeUrl = url + '?token=' + localStorage.getItem('token') + '&customerId=' + localStorage.getItem('customerId') // this.iframeUrl =
return isURL(url) // url +
// "?token=" +
// localStorage.getItem("token") +
// "&customerId=" +
// localStorage.getItem("customerId");
return isURL(url);
}, },
// tabs, tab // tabs, tab
tabSelectedHandle (tab) { tabSelectedHandle(tab) {
tab = this.$store.state.contentTabs.filter(item => item.name === tab.name)[0] tab = this.$store.state.contentTabs.filter(
(item) => item.name === tab.name
)[0];
if (tab) { if (tab) {
this.$router.push({ this.$router.push({
'name': tab.name, name: tab.name,
'params': { ...tab.params }, params: { ...tab.params },
'query': { ...tab.query } query: { ...tab.query },
}) });
} }
}, },
// tabs, tab // tabs, tab
tabRemoveHandle (tabName) { tabRemoveHandle(tabName) {
if (tabName === 'home') { if (tabName === "home") {
return false return false;
} }
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName) this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
);
if (this.$store.state.contentTabs.length <= 0) { if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home' this.$store.state.sidebarMenuActiveName =
return false this.$store.state.contentTabsActiveName = "home";
return false;
} }
// tab // tab
if (tabName === this.$store.state.contentTabsActiveName) { if (tabName === this.$store.state.contentTabsActiveName) {
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1] let tab =
this.$store.state.contentTabs[
this.$store.state.contentTabs.length - 1
];
this.$router.push({ this.$router.push({
name: tab.name, name: tab.name,
params: { ...tab.params }, params: { ...tab.params },
query: { ...tab.query } query: { ...tab.query },
}) });
} }
}, },
// tabs, // tabs,
tabsCloseOtherHandle () { tabsCloseOtherHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => { this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
return item.name === 'home' || item.name === this.$store.state.contentTabsActiveName (item) => {
}) return (
item.name === "home" ||
item.name === this.$store.state.contentTabsActiveName
);
}
);
}, },
// tabs, // tabs,
tabsCloseAllHandle () { tabsCloseAllHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home') this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
this.$router.push({ name: 'home' }) (item) => item.name === "home"
);
this.$router.push({ name: "home" });
}, },
sendMessage () { },
// const iframe = this.$refs.iframes.contentWindow };
const iframe = document.getElementsByClassName('iframes')[0].contentWindow
console.log('iframe', iframe)
// iframe.postMessage({
// token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId')
// }, '*')
iframe.postMessage({ name: 'lalalal' }, '*')
},
}
}
</script> </script>
<style lang="scss" src="@/assets/scss/main-shuju.scss" scoped></style> <style lang="scss" src="@/assets/scss/main-shuju.scss" scoped></style>

2
src/views/modules/base/resi.vue

@ -17,7 +17,7 @@
class="upload-demo" class="upload-demo"
action="uploadUlr" action="uploadUlr"
:limit="1" :limit="1"
:accept="'.xls,xlsx'" :accept="'.xls,.xlsx'"
:with-credentials="true" :with-credentials="true"
:show-file-list="false" :show-file-list="false"
:auto-upload="true" :auto-upload="true"

1
src/views/modules/communityParty/elegant/index.vue

@ -57,6 +57,7 @@
class="upload-demo" class="upload-demo"
action="uploadUlr" action="uploadUlr"
:limit="1" :limit="1"
:accept="'.xls,.xlsx'"
:with-credentials="true" :with-credentials="true"
:show-file-list="false" :show-file-list="false"
:auto-upload="true" :auto-upload="true"

4
src/views/modules/communityService/measure/index.vue

@ -163,14 +163,14 @@
:prop="item.columnName" :prop="item.columnName"
:label="item.label" :label="item.label"
:align="item.align" :align="item.align"
:width="item.width" :min-width="item.width"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item) }}</span> <span>{{ handleFilterSpan(scope.row, item) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="200"> <el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="filterEdit(scope.row.agencyId)"> <template v-if="filterEdit(scope.row.agencyId)">
<el-button <el-button

1
src/views/modules/communityService/sqzzz/index.vue

@ -44,6 +44,7 @@
class="upload-btn" class="upload-btn"
action="uploadUlr" action="uploadUlr"
:limit="1" :limit="1"
:accept="'.xls,.xlsx'"
:with-credentials="true" :with-credentials="true"
:show-file-list="false" :show-file-list="false"
:auto-upload="true" :auto-upload="true"

9
src/views/modules/workPc/guidance/guidanceList.vue

@ -136,11 +136,12 @@ export default {
operations: [ operations: [
{ {
lable: '详情', // lable: '详情', //
size: 'mini', size: 'small',
style: 'margin: 0 6px;', style: 'margin: 0 6px;',
type: 'text', type: 'text',
slot: '', slot: '',
plain: false, plain: false,
class: 'div-table-button--detail',
methodName: 'detail', // methodName: 'detail', //
isShow: (row) => { isShow: (row) => {
return true return true
@ -148,11 +149,12 @@ export default {
}, },
{ {
lable: '修改', // lable: '修改', //
size: 'mini', size: 'small',
style: 'margin: 0 6px;', style: 'margin: 0 6px;',
type: 'text', type: 'text',
slot: '', slot: '',
plain: false, plain: false,
class: 'div-table-button--edit',
methodName: 'edit', // methodName: 'edit', //
isShow: (row) => { isShow: (row) => {
// return true // return true
@ -165,11 +167,12 @@ export default {
}, },
{ {
lable: '删除', // lable: '删除', //
size: 'mini', size: 'small',
style: 'margin: 0 6px;', style: 'margin: 0 6px;',
type: 'text', type: 'text',
slot: '', slot: '',
plain: false, plain: false,
class: 'div-table-button--delete',
methodName: 'confirmDel', // methodName: 'confirmDel', //
isShow: (row) => { isShow: (row) => {
if (row.createdId === this.userId) { if (row.createdId === this.userId) {

2
src/views/modules/workSys/resiCate.vue

@ -75,7 +75,7 @@
<span v-else>{{ handleFilterSpan(scope.row, item) }}</span> <span v-else>{{ handleFilterSpan(scope.row, item) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="120"> <el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@click="handleLook(scope.row)" @click="handleLook(scope.row)"

Loading…
Cancel
Save