master
e 8 months ago
parent 9d8e500f53
commit 5dd3fa9859

@ -9,7 +9,8 @@
<script src="<%= BASE_URL %>MarkerClusterer_min.js"></script> <script src="<%= BASE_URL %>MarkerClusterer_min.js"></script>
<script src="<%= BASE_URL %>map_load.js"></script> <script src="<%= BASE_URL %>map_load.js"></script>
<script src="<%= BASE_URL %>liveplayer-lib.min.js"></script> <script src="<%= BASE_URL %>liveplayer-lib.min.js"></script>
<title>镇海平安企业(园区)</title> <!-- <title>镇海平安企业(园区)</title> -->
<title>vue</title>
</head> </head>
<style> <style>
body{ body{

@ -0,0 +1,38 @@
<template>
<div class="gDict">
<!--<g-dict :options="idTypeList" :value="scope.row.labelId"></g-dict>-->
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span :key="item.value" :index="index">{{ item.label }}</span>
</template>
</template>
</div>
</template>
<script>
export default {
props: {
value: {
type: [Number, String, Array],
},
options: {
type: Array,
default() {
return [];
},
},
},
data() {
return {};
},
computed: {
values() {
if (this.value !== null && typeof this.value !== "undefined") {
return Array.isArray(this.value) ? this.value : [String(this.value)];
} else {
return [];
}
},
},
};
</script>

@ -3,6 +3,7 @@
<el-table <el-table
ref="gMainTable" ref="gMainTable"
size="small" size="small"
:header-cell-style="$tableHeaderColor"
:data="tableData" :data="tableData"
:rowKey="rowKey ? rowKey : ''" :rowKey="rowKey ? rowKey : ''"
@selection-change="selectionChange" @selection-change="selectionChange"
@ -41,6 +42,7 @@
<div class="gPagination" v-if="pagination"> <div class="gPagination" v-if="pagination">
<el-pagination <el-pagination
background
v-bind="{ ...pagination }" v-bind="{ ...pagination }"
@size-change="pageSizeChange" @size-change="pageSizeChange"
@current-change="currentPageChange" @current-change="currentPageChange"

@ -0,0 +1,34 @@
<template>
<div class="gUpload">
<el-upload
action="https://jsonplaceholder.typicode.com/posts/"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
dialogImageUrl: "",
dialogVisible: false,
};
},
methods: {
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
},
};
</script>

@ -0,0 +1,14 @@
const install = (Vue) => {
//改变table header的背景色
Vue.prototype.$tableHeaderColor = ({
row,
column,
rowIndex,
columnIndex,
}) => {
if (rowIndex === 0) {
return "padding:10px 0;background-color: #F5F7FA; color: #303133; font-size: 14px; font-weight: 600;border-bottom:solid 1px #EAEEF6;";
}
};
};
export default install;

@ -17,6 +17,7 @@ import * as cusRule from '@/loveflow/rules'
import { registerPlugins } from '@/loveflow/plugins/index' import { registerPlugins } from '@/loveflow/plugins/index'
import FormDialog from '@/loveflow/components/modal/formDialog.vue' import FormDialog from '@/loveflow/components/modal/formDialog.vue'
import gMainTable from '@/loveflow/components/data/table.vue' import gMainTable from '@/loveflow/components/data/table.vue'
import gDict from '@/loveflow/components/data/dict.vue'
import * as echarts from "echarts"; import * as echarts from "echarts";
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;
@ -32,6 +33,7 @@ Vue.component('lkyTable', lkyTable)
Vue.component('lkyPagination',lkyPagination) Vue.component('lkyPagination',lkyPagination)
Vue.component('FormDialog', FormDialog) Vue.component('FormDialog', FormDialog)
Vue.component('gMainTable', gMainTable) Vue.component('gMainTable', gMainTable)
Vue.component('gDict', gDict)
const vm = new Vue({ const vm = new Vue({
el: '#app', el: '#app',
router, router,

@ -1,6 +1,8 @@
<template> <template>
<div> <div>
<div class="search">11</div> <div class="search">
<gDict :options="dictList" :value="'1'"></gDict>
</div>
<el-button @click="add"></el-button> <el-button @click="add"></el-button>
@ -116,6 +118,16 @@ export default {
}, },
}, },
], ],
dictList: [
{
value: "1",
label: "这是状态码1",
},
{
value: "2",
label: "这是状态码2",
},
],
}; };
}, },
methods: { methods: {

Loading…
Cancel
Save