Commit 50175133 authored by 骆瑛's avatar 骆瑛

Merge branch 'portal' of http://git.mes123.com/zhouyx/mes-ui into portal

parents 8940cc3a 255462d1
...@@ -285,6 +285,13 @@ html body { ...@@ -285,6 +285,13 @@ html body {
.pl20 { .pl20 {
padding-left: 20px padding-left: 20px
} }
.pr10 {
padding-right: 10px
}
.pr20 {
padding-right: 20px
}
.bnone { .bnone {
border: none; border: none;
...@@ -698,7 +705,18 @@ i.icon-gengxin { ...@@ -698,7 +705,18 @@ i.icon-gengxin {
.tc { .tc {
text-align: center; text-align: center;
} }
.lt30
{
line-height: 30px;
}
.lt40
{
line-height: 40px;
}
.lt50
{
line-height: 50px;
}
/*清除浮动*/ /*清除浮动*/
......
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
treeData: [], //物料数据 treeData: [], //物料数据
codeRuleData: [], //物料编码 codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程 routingHeaderData: [], //工艺规程
allUser: []
}; };
}, },
props: { props: {
...@@ -277,6 +278,7 @@ export default { ...@@ -277,6 +278,7 @@ export default {
//this.getTreeData(); //this.getTreeData();
//this.getcodeRuleData(); //this.getcodeRuleData();
//this.getRoutingHeaderData(); //this.getRoutingHeaderData();
this.getAllUser()
}, },
methods: { methods: {
//数据加载 //数据加载
...@@ -477,6 +479,36 @@ export default { ...@@ -477,6 +479,36 @@ export default {
this.footerToolbar = false; this.footerToolbar = false;
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
}, },
//获取所有用户信息
getAllUser() {
this.$api.post(`${systemUrl}/user/paged`, {
conditions: [],
pageIndex: 1,
pageSize: 100000,
})
.then((r) => {
if (r.success) {
let tempUserInfo = r.result.items
tempUserInfo.forEach(ele => {
let temObj = {
userId: ele.id,
name: ele.userName
}
this.allUser.push(temObj)
})
}
})
},
getUserName(id) {
let name = ''
this.allUser.forEach(ele => {
if (id == ele.userId) {
name = ele.name
}
})
return name
},
//导出excel //导出excel
export2Excel() { export2Excel() {
...@@ -516,10 +548,13 @@ export default { ...@@ -516,10 +548,13 @@ export default {
}; };
this.$api.post(this.action, searchs).then((r) => { this.$api.post(this.action, searchs).then((r) => {
let list = []; let list = [];
list = r.result.items; if (r.success) {
list = r.result.items || [];
}
const tHeader = []; // 设置Excel的表格第一行的标题 const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性 const filterVal = []; //list里对象的属性
var tempCol = []; var tempCol = [];
var tempColUser = [];
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => { columnsCur.forEach((el) => {
if ( if (
...@@ -535,19 +570,64 @@ export default { ...@@ -535,19 +570,64 @@ export default {
code: el.code, code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code }); //临时存放code数据字典的字段及对应的数据字典code
} }
if (el.type && el.type == "user") {
tempColUser.push({
key: el.key,
code: el.type,
}); //临时存放user列
}
tHeader.push(el.title); tHeader.push(el.title);
filterVal.push(el.key); filterVal.push(el.key);
} }
}); });
list.forEach((e) => { list.forEach((e) => {
//给导出数据增加数据字典对应的name //给导出数据增加数据字典对应的name
tempCol.forEach((ele) => { // tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName( // e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code), // this.$store.getters.dictionaryByKey(ele.code),
e[ele.key] // e[ele.key]
); // );
// });
tempCol.forEach((elem) => {
if (
e[elem.key] &&
e[elem.key] != "" &&
e[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = e[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
e[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
e[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirName(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
}); });
tempColUser.forEach(eluser => {
if (
e[eluser.key] &&
e[eluser.key] != "" &&
e[eluser.key] != null
) {
e[eluser.key] = this.getUserName(e[eluser.key])
}
})
}); });
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
...@@ -560,7 +640,6 @@ export default { ...@@ -560,7 +640,6 @@ export default {
); );
}); });
}, },
}, },
computed: { computed: {
columnsNow() { columnsNow() {
......
...@@ -251,12 +251,34 @@ export default { ...@@ -251,12 +251,34 @@ export default {
} }
arrTitleUse.forEach((elem) => { arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) { if (
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值 eles[elem.key] &&
eles[elem.key] = this.$u.dirCode( eles[elem.key] != "" &&
this.$store.getters.dictionaryByKey(elem.code), eles[elem.key] != null
eles[elem.key] ) {
); //如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = eles[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirCode(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
eles[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
} }
}); });
......
<template> <template>
<div> <div>
<Input v-model.trim="curModel" @on-change="change" placeholder="请输入图标" @> <Input v-model.trim="curModel" @on-change="change" placeholder="请输入图标">
<span slot="prepend"> <span slot="prepend">
<a @click="iconModal=true" class="setIcon"> <a @click="iconModal=true" class="setIcon">
<Icon :type="type"></Icon> <Icon :type="type"></Icon>
</a> </a>
</span> </span>
<span slot="append">
<a @click="clearIcon" class="setIcon">
<Icon type="ios-close" />
</a>
</span>
</Input> </Input>
<Modal v-model="iconModal" title="设置图标" :width="800"> <Modal v-model="iconModal" title="设置图标" :width="800">
<div id="icons"> <div id="icons">
<a v-for="(icon,i) in iconList" :key="i" @click="setIcon(icon)" :title="icon"> <a v-for="(icon,i) in iconList" :key="i" @click="setIcon(icon)" :title="icon">
<Icon :type="icon" size="36"></Icon> <Icon :type="icon" size="36"></Icon>
</a> </a>
</div> </div>
<div slot="footer"></div> <div slot="footer"></div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
model:{ model: {
prop:"value", prop: "value",
event:"on-change" event: "on-change"
}, },
props:{ props: {
value:{ value: {
type:String type: String
} }
}, },
name: 'InputIcon', name: 'InputIcon',
data() { data() {
return { return {
curModel:this.value, curModel: this.value,
iconModal: false, iconModal: false,
icons: icons: 'ios-add,md-add,ios-add-circle,ios-add-circle-outline,md-add-circle,ios-alarm,ios-alarm-outline,md-alarm,ios-albums,ios-albums-outline,md-albums,ios-alert,ios-alert-outline,md-alert,ios-american-football,ios-american-football-outline,md-american-football,ios-analytics,ios-analytics-outline,md-analytics,logo-android,logo-angular,ios-aperture,ios-aperture-outline,md-aperture,logo-apple,ios-apps,ios-apps-outline,md-apps,ios-appstore,ios-appstore-outline,md-appstore,ios-archive,ios-archive-outline,md-archive,ios-arrow-back,md-arrow-back,ios-arrow-down,md-arrow-down,ios-arrow-dropdown,md-arrow-dropdown,ios-arrow-dropdown-circle,md-arrow-dropdown-circle,ios-arrow-dropleft,md-arrow-dropleft,ios-arrow-dropleft-circle,md-arrow-dropleft-circle,ios-arrow-dropright,md-arrow-dropright,ios-arrow-dropright-circle,md-arrow-dropright-circle,ios-arrow-dropup,md-arrow-dropup,ios-arrow-dropup-circle,md-arrow-dropup-circle,ios-arrow-forward,md-arrow-forward,ios-arrow-round-back,md-arrow-round-back,ios-arrow-round-down,md-arrow-round-down,ios-arrow-round-forward,md-arrow-round-forward,ios-arrow-round-up,md-arrow-round-up,ios-arrow-up,md-arrow-up,ios-at,ios-at-outline,md-at,ios-attach,md-attach,ios-backspace,ios-backspace-outline,md-backspace,ios-barcode,ios-barcode-outline,md-barcode,ios-baseball,ios-baseball-outline,md-baseball,ios-basket,ios-basket-outline,md-basket,ios-basketball,ios-basketball-outline,md-basketball,ios-battery-charging,md-battery-charging,ios-battery-dead,md-battery-dead,ios-battery-full,md-battery-full,ios-beaker,ios-beaker-outline,md-beaker,ios-beer,ios-beer-outline,md-beer,ios-bicycle,md-bicycle,logo-bitcoin,ios-bluetooth,md-bluetooth,ios-boat,ios-boat-outline,md-boat,ios-body,ios-body-outline,md-body,ios-bonfire,ios-bonfire-outline,md-bonfire,ios-book,ios-book-outline,md-book,ios-bookmark,ios-bookmark-outline,md-bookmark,ios-bookmarks,ios-bookmarks-outline,md-bookmarks,ios-bowtie,ios-bowtie-outline,md-bowtie,ios-briefcase,ios-briefcase-outline,md-briefcase,ios-browsers,ios-browsers-outline,md-browsers,ios-brush,ios-brush-outline,md-brush,logo-buffer,ios-bug,ios-bug-outline,md-bug,ios-build,ios-build-outline,md-build,ios-bulb,ios-bulb-outline,md-bulb,ios-bus,ios-bus-outline,md-bus,ios-cafe,ios-cafe-outline,md-cafe,ios-calculator,ios-calculator-outline,md-calculator,ios-calendar,ios-calendar-outline,md-calendar,ios-call,ios-call-outline,md-call,ios-camera,ios-camera-outline,md-camera,ios-car,ios-car-outline,md-car,ios-card,ios-card-outline,md-card,ios-cart,ios-cart-outline,md-cart,ios-cash,ios-cash-outline,md-cash,ios-chatboxes,ios-chatboxes-outline,md-chatboxes,ios-chatbubbles,ios-chatbubbles-outline,md-chatbubbles,ios-checkbox,ios-checkbox-outline,md-checkbox,md-checkbox-outline,ios-checkmark,md-checkmark,ios-checkmark-circle,ios-checkmark-circle-outline,md-checkmark-circle,md-checkmark-circle-outline,logo-chrome,ios-clipboard,ios-clipboard-outline,md-clipboard,ios-clock,ios-clock-outline,md-clock,ios-close,md-close,ios-close-circle,ios-close-circle-outline,md-close-circle,ios-closed-captioning,ios-closed-captioning-outline,md-closed-captioning,ios-cloud,ios-cloud-outline,md-cloud,ios-cloud-circle,ios-cloud-circle-outline,md-cloud-circle,ios-cloud-done,ios-cloud-done-outline,md-cloud-done,ios-cloud-download,ios-cloud-download-outline,md-cloud-download,md-cloud-outline,ios-cloud-upload,ios-cloud-upload-outline,md-cloud-upload,ios-cloudy,ios-cloudy-outline,md-cloudy,ios-cloudy-night,ios-cloudy-night-outline,md-cloudy-night,ios-code,md-code,ios-code-download,md-code-download,ios-code-working,md-code-working,logo-codepen,ios-cog,ios-cog-outline,md-cog,ios-color-fill,ios-color-fill-outline,md-color-fill,ios-color-filter,ios-color-filter-outline,md-color-filter,ios-color-palette,ios-color-palette-outline,md-color-palette,ios-color-wand,ios-color-wand-outline,md-color-wand,ios-compass,ios-compass-outline,md-compass,ios-construct,ios-construct-outline,md-construct,ios-contact,ios-contact-outline,md-contact,ios-contacts,ios-contacts-outline,md-contacts,ios-contract,md-contract,ios-contrast,md-contrast,ios-copy,ios-copy-outline,md-copy,ios-create,ios-create-outline,md-create,ios-crop,ios-crop-outline,md-crop,logo-css3,ios-cube,ios-cube-outline,md-cube,ios-cut,ios-cut-outline,md-cut,logo-designernews,ios-desktop,ios-desktop-outline,md-desktop,ios-disc,ios-disc-outline,md-disc,ios-document,ios-document-outline,md-document,ios-done-all,md-done-all,ios-download,ios-download-outline,md-download,logo-dribbble,logo-dropbox,ios-easel,ios-easel-outline,md-easel,ios-egg,ios-egg-outline,md-egg,logo-euro,ios-exit,ios-exit-outline,md-exit,ios-expand,md-expand,ios-eye,ios-eye-outline,md-eye,ios-eye-off,ios-eye-off-outline,md-eye-off,logo-facebook,ios-fastforward,ios-fastforward-outline,md-fastforward,ios-female,md-female,ios-filing,ios-filing-outline,md-filing,ios-film,ios-film-outline,md-film,ios-finger-print,md-finger-print,ios-flag,ios-flag-outline,md-flag,ios-flame,ios-flame-outline,md-flame,ios-flash,ios-flash-outline,md-flash,ios-flask,ios-flask-outline,md-flask,ios-flower,ios-flower-outline,md-flower,ios-folder,ios-folder-outline,md-folder,ios-folder-open,ios-folder-open-outline,md-folder-open,ios-football,ios-football-outline,md-football,logo-foursquare,logo-freebsd-devil,ios-funnel,ios-funnel-outline,md-funnel,ios-game-controller-a,ios-game-controller-a-outline,md-game-controller-a,ios-game-controller-b,ios-game-controller-b-outline,md-game-controller-b,ios-git-branch,md-git-branch,ios-git-commit,md-git-commit,ios-git-compare,md-git-compare,ios-git-merge,md-git-merge,ios-git-network,md-git-network,ios-git-pull-request,md-git-pull-request,logo-github,ios-glasses,ios-glasses-outline,md-glasses,ios-globe,ios-globe-outline,md-globe,logo-google,logo-googleplus,ios-grid,ios-grid-outline,md-grid,logo-hackernews,ios-hammer,ios-hammer-outline,md-hammer,ios-hand,ios-hand-outline,md-hand,ios-happy,ios-happy-outline,md-happy,ios-headset,ios-headset-outline,md-headset,ios-heart,ios-heart-outline,md-heart,md-heart-outline,ios-help,md-help,ios-help-buoy,ios-help-buoy-outline,md-help-buoy,ios-help-circle,ios-help-circle-outline,md-help-circle,ios-home,ios-home-outline,md-home,logo-html5,ios-ice-cream,ios-ice-cream-outline,md-ice-cream,ios-image,ios-image-outline,md-image,ios-images,ios-images-outline,md-images,ios-infinite,ios-infinite-outline,md-infinite,ios-information,md-information,ios-information-circle,ios-information-circle-outline,md-information-circle,logo-instagram,ios-ionic,ios-ionic-outline,md-ionic,ios-ionitron,ios-ionitron-outline,md-ionitron,logo-javascript,ios-jet,ios-jet-outline,md-jet,ios-key,ios-key-outline,md-key,ios-keypad,ios-keypad-outline,md-keypad,ios-laptop,md-laptop,ios-leaf,ios-leaf-outline,md-leaf,ios-link,ios-link-outline,md-link,logo-linkedin,ios-list,md-list,ios-list-box,ios-list-box-outline,md-list-box,ios-locate,ios-locate-outline,md-locate,ios-lock,ios-lock-outline,md-lock,ios-log-in,md-log-in,ios-log-out,md-log-out,ios-magnet,ios-magnet-outline,md-magnet,ios-mail,ios-mail-outline,md-mail,ios-mail-open,ios-mail-open-outline,md-mail-open,ios-male,md-male,ios-man,ios-man-outline,md-man,ios-map,ios-map-outline,md-map,logo-markdown,ios-medal,ios-medal-outline,md-medal,ios-medical,ios-medical-outline,md-medical,ios-medkit,ios-medkit-outline,md-medkit,ios-megaphone,ios-megaphone-outline,md-megaphone,ios-menu,ios-menu-outline,md-menu,ios-mic,ios-mic-outline,md-mic,ios-mic-off,ios-mic-off-outline,md-mic-off,ios-microphone,ios-microphone-outline,md-microphone,ios-moon,ios-moon-outline,md-moon,ios-more,ios-more-outline,md-more,ios-move,md-move,ios-musical-note,ios-musical-note-outline,md-musical-note,ios-musical-notes,ios-musical-notes-outline,md-musical-notes,ios-navigate,ios-navigate-outline,md-navigate,ios-no-smoking,ios-no-smoking-outline,md-no-smoking,logo-nodejs,ios-notifications,ios-notifications-outline,md-notifications,ios-notifications-off,ios-notifications-off-outline,md-notifications-off,md-notifications-outline,ios-nuclear,ios-nuclear-outline,md-nuclear,ios-nutrition,ios-nutrition-outline,md-nutrition,logo-octocat,ios-open,ios-open-outline,md-open,ios-options,ios-options-outline,md-options,ios-outlet,ios-outlet-outline,md-outlet,ios-paper,ios-paper-outline,md-paper,ios-paper-plane,ios-paper-plane-outline,md-paper-plane,ios-partly-sunny,ios-partly-sunny-outline,md-partly-sunny,ios-pause,ios-pause-outline,md-pause,ios-paw,ios-paw-outline,md-paw,ios-people,ios-people-outline,md-people,ios-person,ios-person-outline,md-person,ios-person-add,ios-person-add-outline,md-person-add,ios-phone-landscape,md-phone-landscape,ios-phone-portrait,md-phone-portrait,ios-photos,ios-photos-outline,md-photos,ios-pie,ios-pie-outline,md-pie,ios-pin,ios-pin-outline,md-pin,ios-pint,ios-pint-outline,md-pint,logo-pinterest,ios-pizza,ios-pizza-outline,md-pizza,ios-plane,ios-plane-outline,md-plane,ios-planet,ios-planet-outline,md-planet,ios-play,ios-play-outline,md-play,logo-playstation,ios-podium,ios-podium-outline,md-podium,ios-power,ios-power-outline,md-power,ios-pricetag,ios-pricetag-outline,md-pricetag,ios-pricetags,ios-pricetags-outline,md-pricetags,ios-print,ios-print-outline,md-print,ios-pulse,ios-pulse-outline,md-pulse,logo-python,ios-qr-scanner,md-qr-scanner,ios-quote,ios-quote-outline,md-quote,ios-radio,ios-radio-outline,md-radio,ios-radio-button-off,md-radio-button-off,ios-radio-button-on,md-radio-button-on,ios-rainy,ios-rainy-outline,md-rainy,ios-recording,ios-recording-outline,md-recording,logo-reddit,ios-redo,ios-redo-outline,md-redo,ios-refresh,md-refresh,ios-refresh-circle,ios-refresh-circle-outline,md-refresh-circle,ios-remove,md-remove,ios-remove-circle,ios-remove-circle-outline,md-remove-circle,ios-reorder,md-reorder,ios-repeat,md-repeat,ios-resize,md-resize,ios-restaurant,ios-restaurant-outline,md-restaurant,ios-return-left,md-return-left,ios-return-right,md-return-right,ios-reverse-camera,ios-reverse-camera-outline,md-reverse-camera,ios-rewind,ios-rewind-outline,md-rewind,ios-ribbon,ios-ribbon-outline,md-ribbon,ios-rose,ios-rose-outline,md-rose,logo-rss,ios-sad,ios-sad-outline,md-sad,logo-sass,ios-school,ios-school-outline,md-school,ios-search,ios-search-outline,md-search,ios-send,ios-send-outline,md-send,ios-settings,ios-settings-outline,md-settings,ios-share,ios-share-outline,md-share,ios-share-alt,ios-share-alt-outline,md-share-alt,ios-shirt,ios-shirt-outline,md-shirt,ios-shuffle,md-shuffle,ios-skip-backward,ios-skip-backward-outline,md-skip-backward,ios-skip-forward,ios-skip-forward-outline,md-skip-forward,logo-skype,logo-snapchat,ios-snow,ios-snow-outline,md-snow,ios-speedometer,ios-speedometer-outline,md-speedometer,ios-square,ios-square-outline,md-square,md-square-outline,ios-star,ios-star-outline,md-star,ios-star-half,md-star-half,md-star-outline,ios-stats,ios-stats-outline,md-stats,logo-steam,ios-stopwatch,ios-stopwatch-outline,md-stopwatch,ios-subway,ios-subway-outline,md-subway,ios-sunny,ios-sunny-outline,md-sunny,ios-swap,md-swap,ios-switch,ios-switch-outline,md-switch,ios-sync,md-sync,ios-tablet-landscape,md-tablet-landscape,ios-tablet-portrait,md-tablet-portrait,ios-tennisball,ios-tennisball-outline,md-tennisball,ios-text,ios-text-outline,md-text,ios-thermometer,ios-thermometer-outline,md-thermometer,ios-thumbs-down,ios-thumbs-down-outline,md-thumbs-down,ios-thumbs-up,ios-thumbs-up-outline,md-thumbs-up,ios-thunderstorm,ios-thunderstorm-outline,md-thunderstorm,ios-time,ios-time-outline,md-time,ios-timer,ios-timer-outline,md-timer,ios-train,ios-train-outline,md-train,ios-transgender,md-transgender,ios-trash,ios-trash-outline,md-trash,ios-trending-down,md-trending-down,ios-trending-up,md-trending-up,ios-trophy,ios-trophy-outline,md-trophy,logo-tumblr,logo-tux,logo-twitch,logo-twitter,ios-umbrella,ios-umbrella-outline,md-umbrella,ios-undo,ios-undo-outline,md-undo,ios-unlock,ios-unlock-outline,md-unlock,logo-usd,ios-videocam,ios-videocam-outline,md-videocam,logo-vimeo,ios-volume-down,md-volume-down,ios-volume-mute,md-volume-mute,ios-volume-off,md-volume-off,ios-volume-up,md-volume-up,ios-walk,md-walk,ios-warning,ios-warning-outline,md-warning,ios-watch,md-watch,ios-water,ios-water-outline,md-water,logo-whatsapp,ios-wifi,ios-wifi-outline,md-wifi,logo-windows,ios-wine,ios-wine-outline,md-wine,ios-woman,ios-woman-outline,md-woman,logo-wordpress,logo-xbox,logo-yahoo,logo-yen,logo-youtube,ios-loading'
'ios-add,md-add,ios-add-circle,ios-add-circle-outline,md-add-circle,ios-alarm,ios-alarm-outline,md-alarm,ios-albums,ios-albums-outline,md-albums,ios-alert,ios-alert-outline,md-alert,ios-american-football,ios-american-football-outline,md-american-football,ios-analytics,ios-analytics-outline,md-analytics,logo-android,logo-angular,ios-aperture,ios-aperture-outline,md-aperture,logo-apple,ios-apps,ios-apps-outline,md-apps,ios-appstore,ios-appstore-outline,md-appstore,ios-archive,ios-archive-outline,md-archive,ios-arrow-back,md-arrow-back,ios-arrow-down,md-arrow-down,ios-arrow-dropdown,md-arrow-dropdown,ios-arrow-dropdown-circle,md-arrow-dropdown-circle,ios-arrow-dropleft,md-arrow-dropleft,ios-arrow-dropleft-circle,md-arrow-dropleft-circle,ios-arrow-dropright,md-arrow-dropright,ios-arrow-dropright-circle,md-arrow-dropright-circle,ios-arrow-dropup,md-arrow-dropup,ios-arrow-dropup-circle,md-arrow-dropup-circle,ios-arrow-forward,md-arrow-forward,ios-arrow-round-back,md-arrow-round-back,ios-arrow-round-down,md-arrow-round-down,ios-arrow-round-forward,md-arrow-round-forward,ios-arrow-round-up,md-arrow-round-up,ios-arrow-up,md-arrow-up,ios-at,ios-at-outline,md-at,ios-attach,md-attach,ios-backspace,ios-backspace-outline,md-backspace,ios-barcode,ios-barcode-outline,md-barcode,ios-baseball,ios-baseball-outline,md-baseball,ios-basket,ios-basket-outline,md-basket,ios-basketball,ios-basketball-outline,md-basketball,ios-battery-charging,md-battery-charging,ios-battery-dead,md-battery-dead,ios-battery-full,md-battery-full,ios-beaker,ios-beaker-outline,md-beaker,ios-beer,ios-beer-outline,md-beer,ios-bicycle,md-bicycle,logo-bitcoin,ios-bluetooth,md-bluetooth,ios-boat,ios-boat-outline,md-boat,ios-body,ios-body-outline,md-body,ios-bonfire,ios-bonfire-outline,md-bonfire,ios-book,ios-book-outline,md-book,ios-bookmark,ios-bookmark-outline,md-bookmark,ios-bookmarks,ios-bookmarks-outline,md-bookmarks,ios-bowtie,ios-bowtie-outline,md-bowtie,ios-briefcase,ios-briefcase-outline,md-briefcase,ios-browsers,ios-browsers-outline,md-browsers,ios-brush,ios-brush-outline,md-brush,logo-buffer,ios-bug,ios-bug-outline,md-bug,ios-build,ios-build-outline,md-build,ios-bulb,ios-bulb-outline,md-bulb,ios-bus,ios-bus-outline,md-bus,ios-cafe,ios-cafe-outline,md-cafe,ios-calculator,ios-calculator-outline,md-calculator,ios-calendar,ios-calendar-outline,md-calendar,ios-call,ios-call-outline,md-call,ios-camera,ios-camera-outline,md-camera,ios-car,ios-car-outline,md-car,ios-card,ios-card-outline,md-card,ios-cart,ios-cart-outline,md-cart,ios-cash,ios-cash-outline,md-cash,ios-chatboxes,ios-chatboxes-outline,md-chatboxes,ios-chatbubbles,ios-chatbubbles-outline,md-chatbubbles,ios-checkbox,ios-checkbox-outline,md-checkbox,md-checkbox-outline,ios-checkmark,md-checkmark,ios-checkmark-circle,ios-checkmark-circle-outline,md-checkmark-circle,md-checkmark-circle-outline,logo-chrome,ios-clipboard,ios-clipboard-outline,md-clipboard,ios-clock,ios-clock-outline,md-clock,ios-close,md-close,ios-close-circle,ios-close-circle-outline,md-close-circle,ios-closed-captioning,ios-closed-captioning-outline,md-closed-captioning,ios-cloud,ios-cloud-outline,md-cloud,ios-cloud-circle,ios-cloud-circle-outline,md-cloud-circle,ios-cloud-done,ios-cloud-done-outline,md-cloud-done,ios-cloud-download,ios-cloud-download-outline,md-cloud-download,md-cloud-outline,ios-cloud-upload,ios-cloud-upload-outline,md-cloud-upload,ios-cloudy,ios-cloudy-outline,md-cloudy,ios-cloudy-night,ios-cloudy-night-outline,md-cloudy-night,ios-code,md-code,ios-code-download,md-code-download,ios-code-working,md-code-working,logo-codepen,ios-cog,ios-cog-outline,md-cog,ios-color-fill,ios-color-fill-outline,md-color-fill,ios-color-filter,ios-color-filter-outline,md-color-filter,ios-color-palette,ios-color-palette-outline,md-color-palette,ios-color-wand,ios-color-wand-outline,md-color-wand,ios-compass,ios-compass-outline,md-compass,ios-construct,ios-construct-outline,md-construct,ios-contact,ios-contact-outline,md-contact,ios-contacts,ios-contacts-outline,md-contacts,ios-contract,md-contract,ios-contrast,md-contrast,ios-copy,ios-copy-outline,md-copy,ios-create,ios-create-outline,md-create,ios-crop,ios-crop-outline,md-crop,logo-css3,ios-cube,ios-cube-outline,md-cube,ios-cut,ios-cut-outline,md-cut,logo-designernews,ios-desktop,ios-desktop-outline,md-desktop,ios-disc,ios-disc-outline,md-disc,ios-document,ios-document-outline,md-document,ios-done-all,md-done-all,ios-download,ios-download-outline,md-download,logo-dribbble,logo-dropbox,ios-easel,ios-easel-outline,md-easel,ios-egg,ios-egg-outline,md-egg,logo-euro,ios-exit,ios-exit-outline,md-exit,ios-expand,md-expand,ios-eye,ios-eye-outline,md-eye,ios-eye-off,ios-eye-off-outline,md-eye-off,logo-facebook,ios-fastforward,ios-fastforward-outline,md-fastforward,ios-female,md-female,ios-filing,ios-filing-outline,md-filing,ios-film,ios-film-outline,md-film,ios-finger-print,md-finger-print,ios-flag,ios-flag-outline,md-flag,ios-flame,ios-flame-outline,md-flame,ios-flash,ios-flash-outline,md-flash,ios-flask,ios-flask-outline,md-flask,ios-flower,ios-flower-outline,md-flower,ios-folder,ios-folder-outline,md-folder,ios-folder-open,ios-folder-open-outline,md-folder-open,ios-football,ios-football-outline,md-football,logo-foursquare,logo-freebsd-devil,ios-funnel,ios-funnel-outline,md-funnel,ios-game-controller-a,ios-game-controller-a-outline,md-game-controller-a,ios-game-controller-b,ios-game-controller-b-outline,md-game-controller-b,ios-git-branch,md-git-branch,ios-git-commit,md-git-commit,ios-git-compare,md-git-compare,ios-git-merge,md-git-merge,ios-git-network,md-git-network,ios-git-pull-request,md-git-pull-request,logo-github,ios-glasses,ios-glasses-outline,md-glasses,ios-globe,ios-globe-outline,md-globe,logo-google,logo-googleplus,ios-grid,ios-grid-outline,md-grid,logo-hackernews,ios-hammer,ios-hammer-outline,md-hammer,ios-hand,ios-hand-outline,md-hand,ios-happy,ios-happy-outline,md-happy,ios-headset,ios-headset-outline,md-headset,ios-heart,ios-heart-outline,md-heart,md-heart-outline,ios-help,md-help,ios-help-buoy,ios-help-buoy-outline,md-help-buoy,ios-help-circle,ios-help-circle-outline,md-help-circle,ios-home,ios-home-outline,md-home,logo-html5,ios-ice-cream,ios-ice-cream-outline,md-ice-cream,ios-image,ios-image-outline,md-image,ios-images,ios-images-outline,md-images,ios-infinite,ios-infinite-outline,md-infinite,ios-information,md-information,ios-information-circle,ios-information-circle-outline,md-information-circle,logo-instagram,ios-ionic,ios-ionic-outline,md-ionic,ios-ionitron,ios-ionitron-outline,md-ionitron,logo-javascript,ios-jet,ios-jet-outline,md-jet,ios-key,ios-key-outline,md-key,ios-keypad,ios-keypad-outline,md-keypad,ios-laptop,md-laptop,ios-leaf,ios-leaf-outline,md-leaf,ios-link,ios-link-outline,md-link,logo-linkedin,ios-list,md-list,ios-list-box,ios-list-box-outline,md-list-box,ios-locate,ios-locate-outline,md-locate,ios-lock,ios-lock-outline,md-lock,ios-log-in,md-log-in,ios-log-out,md-log-out,ios-magnet,ios-magnet-outline,md-magnet,ios-mail,ios-mail-outline,md-mail,ios-mail-open,ios-mail-open-outline,md-mail-open,ios-male,md-male,ios-man,ios-man-outline,md-man,ios-map,ios-map-outline,md-map,logo-markdown,ios-medal,ios-medal-outline,md-medal,ios-medical,ios-medical-outline,md-medical,ios-medkit,ios-medkit-outline,md-medkit,ios-megaphone,ios-megaphone-outline,md-megaphone,ios-menu,ios-menu-outline,md-menu,ios-mic,ios-mic-outline,md-mic,ios-mic-off,ios-mic-off-outline,md-mic-off,ios-microphone,ios-microphone-outline,md-microphone,ios-moon,ios-moon-outline,md-moon,ios-more,ios-more-outline,md-more,ios-move,md-move,ios-musical-note,ios-musical-note-outline,md-musical-note,ios-musical-notes,ios-musical-notes-outline,md-musical-notes,ios-navigate,ios-navigate-outline,md-navigate,ios-no-smoking,ios-no-smoking-outline,md-no-smoking,logo-nodejs,ios-notifications,ios-notifications-outline,md-notifications,ios-notifications-off,ios-notifications-off-outline,md-notifications-off,md-notifications-outline,ios-nuclear,ios-nuclear-outline,md-nuclear,ios-nutrition,ios-nutrition-outline,md-nutrition,logo-octocat,ios-open,ios-open-outline,md-open,ios-options,ios-options-outline,md-options,ios-outlet,ios-outlet-outline,md-outlet,ios-paper,ios-paper-outline,md-paper,ios-paper-plane,ios-paper-plane-outline,md-paper-plane,ios-partly-sunny,ios-partly-sunny-outline,md-partly-sunny,ios-pause,ios-pause-outline,md-pause,ios-paw,ios-paw-outline,md-paw,ios-people,ios-people-outline,md-people,ios-person,ios-person-outline,md-person,ios-person-add,ios-person-add-outline,md-person-add,ios-phone-landscape,md-phone-landscape,ios-phone-portrait,md-phone-portrait,ios-photos,ios-photos-outline,md-photos,ios-pie,ios-pie-outline,md-pie,ios-pin,ios-pin-outline,md-pin,ios-pint,ios-pint-outline,md-pint,logo-pinterest,ios-pizza,ios-pizza-outline,md-pizza,ios-plane,ios-plane-outline,md-plane,ios-planet,ios-planet-outline,md-planet,ios-play,ios-play-outline,md-play,logo-playstation,ios-podium,ios-podium-outline,md-podium,ios-power,ios-power-outline,md-power,ios-pricetag,ios-pricetag-outline,md-pricetag,ios-pricetags,ios-pricetags-outline,md-pricetags,ios-print,ios-print-outline,md-print,ios-pulse,ios-pulse-outline,md-pulse,logo-python,ios-qr-scanner,md-qr-scanner,ios-quote,ios-quote-outline,md-quote,ios-radio,ios-radio-outline,md-radio,ios-radio-button-off,md-radio-button-off,ios-radio-button-on,md-radio-button-on,ios-rainy,ios-rainy-outline,md-rainy,ios-recording,ios-recording-outline,md-recording,logo-reddit,ios-redo,ios-redo-outline,md-redo,ios-refresh,md-refresh,ios-refresh-circle,ios-refresh-circle-outline,md-refresh-circle,ios-remove,md-remove,ios-remove-circle,ios-remove-circle-outline,md-remove-circle,ios-reorder,md-reorder,ios-repeat,md-repeat,ios-resize,md-resize,ios-restaurant,ios-restaurant-outline,md-restaurant,ios-return-left,md-return-left,ios-return-right,md-return-right,ios-reverse-camera,ios-reverse-camera-outline,md-reverse-camera,ios-rewind,ios-rewind-outline,md-rewind,ios-ribbon,ios-ribbon-outline,md-ribbon,ios-rose,ios-rose-outline,md-rose,logo-rss,ios-sad,ios-sad-outline,md-sad,logo-sass,ios-school,ios-school-outline,md-school,ios-search,ios-search-outline,md-search,ios-send,ios-send-outline,md-send,ios-settings,ios-settings-outline,md-settings,ios-share,ios-share-outline,md-share,ios-share-alt,ios-share-alt-outline,md-share-alt,ios-shirt,ios-shirt-outline,md-shirt,ios-shuffle,md-shuffle,ios-skip-backward,ios-skip-backward-outline,md-skip-backward,ios-skip-forward,ios-skip-forward-outline,md-skip-forward,logo-skype,logo-snapchat,ios-snow,ios-snow-outline,md-snow,ios-speedometer,ios-speedometer-outline,md-speedometer,ios-square,ios-square-outline,md-square,md-square-outline,ios-star,ios-star-outline,md-star,ios-star-half,md-star-half,md-star-outline,ios-stats,ios-stats-outline,md-stats,logo-steam,ios-stopwatch,ios-stopwatch-outline,md-stopwatch,ios-subway,ios-subway-outline,md-subway,ios-sunny,ios-sunny-outline,md-sunny,ios-swap,md-swap,ios-switch,ios-switch-outline,md-switch,ios-sync,md-sync,ios-tablet-landscape,md-tablet-landscape,ios-tablet-portrait,md-tablet-portrait,ios-tennisball,ios-tennisball-outline,md-tennisball,ios-text,ios-text-outline,md-text,ios-thermometer,ios-thermometer-outline,md-thermometer,ios-thumbs-down,ios-thumbs-down-outline,md-thumbs-down,ios-thumbs-up,ios-thumbs-up-outline,md-thumbs-up,ios-thunderstorm,ios-thunderstorm-outline,md-thunderstorm,ios-time,ios-time-outline,md-time,ios-timer,ios-timer-outline,md-timer,ios-train,ios-train-outline,md-train,ios-transgender,md-transgender,ios-trash,ios-trash-outline,md-trash,ios-trending-down,md-trending-down,ios-trending-up,md-trending-up,ios-trophy,ios-trophy-outline,md-trophy,logo-tumblr,logo-tux,logo-twitch,logo-twitter,ios-umbrella,ios-umbrella-outline,md-umbrella,ios-undo,ios-undo-outline,md-undo,ios-unlock,ios-unlock-outline,md-unlock,logo-usd,ios-videocam,ios-videocam-outline,md-videocam,logo-vimeo,ios-volume-down,md-volume-down,ios-volume-mute,md-volume-mute,ios-volume-off,md-volume-off,ios-volume-up,md-volume-up,ios-walk,md-walk,ios-warning,ios-warning-outline,md-warning,ios-watch,md-watch,ios-water,ios-water-outline,md-water,logo-whatsapp,ios-wifi,ios-wifi-outline,md-wifi,logo-windows,ios-wine,ios-wine-outline,md-wine,ios-woman,ios-woman-outline,md-woman,logo-wordpress,logo-xbox,logo-yahoo,logo-yen,logo-youtube,ios-loading' }
}
},
computed: {
iconList() {
return this.icons.split(',')
}, },
type(){ computed: {
if(this.curModel&&this.curModel!=''){ iconList() {
return this.curModel return this.icons.split(',')
}else{ },
return "md-add" type() {
if (this.curModel && this.curModel != '') {
return this.curModel
} else {
return "md-add"
}
} }
}
},
methods: {
setIcon(name) {
this.curModel=name;
this.iconModal=false;
this.$emit('on-change', name)
}, },
change(name){ methods: {
this.$emit('on-change', name) setIcon(name) {
} this.curModel = name;
}, this.iconModal = false;
watch:{ this.$emit('on-change', name)
value: { },
handler(v, o) { change(name) {
this.curModel = v this.$emit('on-change', name)
}, },
deep: true clearIcon() {
this.curModel = '';
this.$emit('on-change', '')
}
},
watch: {
value: {
handler(v, o) {
this.curModel = v
},
deep: true
}
} }
}
} }
</script> </script>
<style lang="less"> <style lang="less">
#icons{ #icons {
max-height: 500px; max-height: 500px;
overflow: auto; overflow: auto;
a{
a {
display: inline-block; display: inline-block;
width: 40px; width: 40px;
height: 40px; height: 40px;
border: 1px solid transparent; border: 1px solid transparent;
} }
a:hover,.checked{
a:hover,
.checked {
border: 1px solid #999; border: 1px solid #999;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -1177,6 +1177,8 @@ export default { ...@@ -1177,6 +1177,8 @@ export default {
requestUrl: '服务地址', requestUrl: '服务地址',
requestParam: '参数', requestParam: '参数',
exception: '异常详细信息', exception: '异常详细信息',
remark:'备注'
}, },
user_message_config: { user_message_config: {
creationTime: '创建时间', creationTime: '创建时间',
......
<template> <template>
<span class="i-layout-header-trigger i-layout-header-trigger-min"> <span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick"> <Dropdown transfer :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Icon type="md-globe" /> <Icon type="md-globe" />
<DropdownMenu slot="list"> <DropdownMenu slot="list">
<DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key"> <DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key">
<span>{{ item.language }}</span> <span>{{ item.language }}</span>
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
</span> </span>
</template> </template>
<script> <script>
import Languages from '@/i18n/locale'; import Languages from '@/i18n/locale';
import { mapState, mapActions } from 'vuex'; import {
mapState,
mapActions
} from 'vuex';
export default { export default {
name: 'iHeaderI18n', name: 'iHeaderI18n',
data () { data() {
return { return {
languages: Languages languages: Languages
} }
}, },
computed: { computed: {
...mapState('admin/i18n', [ ...mapState('admin/i18n', [
'locale' 'locale'
]), ]),
...mapState('admin/layout', [ ...mapState('admin/layout', [
'isMobile' 'isMobile'
]) ])
}, },
methods: { methods: {
...mapActions('admin/i18n', [ ...mapActions('admin/i18n', [
'setLocale' 'setLocale'
]), ]),
handleClick (locale) { handleClick(locale) {
if (locale === this.locale) return; if (locale === this.locale) return;
this.setLocale({ locale, vm: this }); this.setLocale({
} locale,
vm: this
});
} }
} }
}
</script> </script>
<template> <template>
<span class="i-layout-header-trigger i-layout-header-trigger-min"> <span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown <Dropdown transfer :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-user" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
:trigger="isMobile ? 'click' : 'hover'" <Avatar size="small" :src="info.avatar" v-if="info.avatar" />
class="i-layout-header-user" <Avatar size="small" style="background-color: #87d068" icon="ios-person" v-else-if="!info.avatar" />
:class="{ 'i-layout-header-user-mobile': isMobile }" <span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span>
@on-click="handleClick" <DropdownMenu slot="list">
> <i-link to="/basicData/userManagent/userInfo">
<Avatar size="small" :src="info.avatar" v-if="info.avatar" /> <DropdownItem>
<Avatar size="small" style="background-color: #87d068" icon="ios-person" v-else-if="!info.avatar" /> <Icon type="ios-contact-outline" />
<span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span> <span>{{ $t('basicLayout.user.center') }}</span>
<DropdownMenu slot="list"> </DropdownItem>
<i-link to="/basicData/userManagent/userInfo"> </i-link>
<DropdownItem> <!-- <i-link to="/setting/account">
<Icon type="ios-contact-outline" />
<span>{{ $t('basicLayout.user.center') }}</span>
</DropdownItem>
</i-link>
<!-- <i-link to="/setting/account">
<DropdownItem> <DropdownItem>
<Icon type="ios-settings-outline" /> <Icon type="ios-settings-outline" />
<span>{{ $t('basicLayout.user.setting') }}</span> <span>{{ $t('basicLayout.user.setting') }}</span>
</DropdownItem> </DropdownItem>
</i-link> --> </i-link> -->
<DropdownItem divided name="logout"> <DropdownItem divided name="logout">
<Icon type="ios-log-out" /> <Icon type="ios-log-out" />
<span>{{ $t('basicLayout.user.logOut') }}</span> <span>{{ $t('basicLayout.user.logOut') }}</span>
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
</span> </span>
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex"; import {
mapState,
mapActions
} from "vuex";
export default { export default {
name: "iHeaderUser", name: "iHeaderUser",
computed: { computed: {
...mapState("admin/user", ["info"]), ...mapState("admin/user", ["info"]),
...mapState("admin/layout", ["isMobile", "logoutConfirm"]) ...mapState("admin/layout", ["isMobile", "logoutConfirm"])
}, },
methods: { methods: {
...mapActions("admin/account", ["logout"]), ...mapActions("admin/account", ["logout"]),
handleClick(name) { handleClick(name) {
if (name === "logout") { if (name === "logout") {
this.logout({ this.logout({
confirm: this.logoutConfirm, confirm: this.logoutConfirm,
vm: this vm: this
}); });
} }
}
} }
}
}; };
</script> </script>
...@@ -4943,7 +4943,7 @@ ...@@ -4943,7 +4943,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.14.1", "version": "2.14.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.14.1.tgz", "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz",
"integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao=" "integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
} }
} }
...@@ -5472,7 +5472,7 @@ ...@@ -5472,7 +5472,7 @@
}, },
"crc-32": { "crc-32": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "http://r.cnpmjs.org/crc-32/download/crc-32-1.2.0.tgz", "resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
"integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=", "integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": { "requires": {
"exit-on-epipe": "~1.0.1", "exit-on-epipe": "~1.0.1",
...@@ -7369,7 +7369,7 @@ ...@@ -7369,7 +7369,7 @@
}, },
"exit-on-epipe": { "exit-on-epipe": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "http://r.cnpmjs.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI=" "integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
}, },
"expand-brackets": { "expand-brackets": {
...@@ -8020,7 +8020,7 @@ ...@@ -8020,7 +8020,7 @@
}, },
"frac": { "frac": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "http://r.cnpmjs.org/frac/download/frac-1.1.2.tgz", "resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
"integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs=" "integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
}, },
"fragment-cache": { "fragment-cache": {
...@@ -15097,7 +15097,7 @@ ...@@ -15097,7 +15097,7 @@
}, },
"printj": { "printj": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "http://r.cnpmjs.org/printj/download/printj-1.1.2.tgz", "resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
"integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=" "integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
}, },
"private": { "private": {
...@@ -20550,7 +20550,7 @@ ...@@ -20550,7 +20550,7 @@
}, },
"script-loader": { "script-loader": {
"version": "0.7.2", "version": "0.7.2",
"resolved": "http://r.cnpmjs.org/script-loader/download/script-loader-0.7.2.tgz", "resolved": "https://registry.npm.taobao.org/script-loader/download/script-loader-0.7.2.tgz",
"integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=", "integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -21138,7 +21138,7 @@ ...@@ -21138,7 +21138,7 @@
}, },
"ssf": { "ssf": {
"version": "0.10.3", "version": "0.10.3",
"resolved": "http://r.cnpmjs.org/ssf/download/ssf-0.10.3.tgz", "resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz",
"integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=", "integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": { "requires": {
"frac": "~1.1.2" "frac": "~1.1.2"
...@@ -23805,7 +23805,7 @@ ...@@ -23805,7 +23805,7 @@
}, },
"wmf": { "wmf": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://r.cnpmjs.org/wmf/download/wmf-1.0.2.tgz", "resolved": "https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz",
"integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto=" "integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
}, },
"word-wrap": { "word-wrap": {
...@@ -23960,7 +23960,7 @@ ...@@ -23960,7 +23960,7 @@
}, },
"xlsx": { "xlsx": {
"version": "0.15.6", "version": "0.15.6",
"resolved": "http://r.cnpmjs.org/xlsx/download/xlsx-0.15.6.tgz", "resolved": "https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz",
"integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=", "integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": { "requires": {
"adler-32": "~1.2.0", "adler-32": "~1.2.0",
...@@ -23975,7 +23975,7 @@ ...@@ -23975,7 +23975,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.17.1", "version": "2.17.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.17.1.tgz", "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78=" "integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
} }
} }
......
...@@ -85,14 +85,14 @@ export default { ...@@ -85,14 +85,14 @@ export default {
}).then(r => { }).then(r => {
if (r > 0) { if (r > 0) {
this.$Message.success("登陆成功!"); this.$Message.success("登陆成功!");
this.initUserInfo(r); this.initUserInfo(r, tenantcode);
} else { } else {
this.$Message.error("登陆失败!"); this.$Message.error("登陆失败!");
} }
}); });
} }
}, },
initUserInfo(id) { initUserInfo(id, tenantCode) {
let parma = { let parma = {
Id: id Id: id
}; };
...@@ -106,8 +106,7 @@ export default { ...@@ -106,8 +106,7 @@ export default {
res.result.avatarUrl = fileUrlDown + res.result.avatarUrl; res.result.avatarUrl = fileUrlDown + res.result.avatarUrl;
} }
let info = res.result; let info = res.result;
info.tenantCode = info.tenantCode = tenantCode;
info.auth = ["admin"];
info.avatar = info.avatarUrl; info.avatar = info.avatarUrl;
info.userId = info.id; info.userId = info.id;
info.name = info.userName; info.name = info.userName;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('departcode')"> <FormItem :label="l('departcode')" prop="departcode">
<Input v-model="entity.departcode" placeholder="请输入..."></Input> <Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -20,10 +20,9 @@ ...@@ -20,10 +20,9 @@
</Col>--> </Col>-->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('upMent')"> <FormItem :label="l('upMent')">
<b>{{entity.name}}</b> <b>{{ entity.name }}</b>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('cityName')"> <FormItem :label="l('cityName')">
<Cascader :data="citys" v-model="location"></Cascader> <Cascader :data="citys" v-model="location"></Cascader>
...@@ -44,7 +43,9 @@ ...@@ -44,7 +43,9 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
<!-- 组织类型 --> <!-- 组织类型 -->
...@@ -63,6 +64,18 @@ export default { ...@@ -63,6 +64,18 @@ export default {
name: "Add", name: "Add",
// components: { OrganizType }, // components: { OrganizType },
data() { data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.isExist(value).then((r) => {
if (r.result) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return { return {
// showTree: false, //组织类型 // showTree: false, //组织类型
disabled: false, disabled: false,
...@@ -73,33 +86,37 @@ export default { ...@@ -73,33 +86,37 @@ export default {
organization_Id: 0, organization_Id: 0,
organization_Type: "", organization_Type: "",
departcode: "", departcode: "",
name:'', name: "",
}, },
property: [], property: [],
location: [], location: [],
rules: { rules: {
title02: [ title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" } { required: true, message: "库位名不能为空", trigger: "blur" },
], ],
organizationType: [ organizationType: [
{ {
required: true, required: true,
message: "组织类型不能为空", message: "组织类型不能为空",
trigger: "blur" trigger: "blur",
} },
] ],
} departcode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
}; };
}, },
props: { props: {
val: Object val: Object,
}, },
created() { created() {
// this.entity = {}; // this.entity = {};
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs["form"].validate(value => { this.$refs["form"].validate((value) => {
if (value) { if (value) {
let isProduction = 0; let isProduction = 0;
let property = []; let property = [];
...@@ -120,18 +137,18 @@ export default { ...@@ -120,18 +137,18 @@ export default {
} }
let location = this.location; let location = this.location;
let paramsdata = { let paramsdata = {
parentTitle:this.entity.name, parentTitle: this.entity.name,
name: this.entity.title02, //部门名称 name: this.entity.title02, //部门名称
parent_Id: this.entity.id, //上级部门 [id] parent_Id: this.entity.id, //上级部门 [id]
code: this.entity.departcode, //部门编号 code: this.entity.departcode, //部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id] // organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location.join(","), //省市县 location: location.join(","), //省市县
isProduction:isProduction, //是否生产班组:1是,0否 isProduction: isProduction, //是否生产班组:1是,0否
property: property.join(",") //属性 property: property.join(","), //属性
}; };
Api.create(paramsdata) Api.create(paramsdata)
.then(r => { .then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功!"); this.$Message.success("保存成功!");
...@@ -140,7 +157,7 @@ export default { ...@@ -140,7 +157,7 @@ export default {
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
}); });
...@@ -156,7 +173,7 @@ export default { ...@@ -156,7 +173,7 @@ export default {
l(key) { l(key) {
key = "DipartLocation" + "." + key; key = "DipartLocation" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
val(v) { val(v) {
...@@ -164,7 +181,7 @@ export default { ...@@ -164,7 +181,7 @@ export default {
this.entity = {}; this.entity = {};
this.entity.name = v.name; this.entity.name = v.name;
this.entity.id = v.id; this.entity.id = v.id;
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('departcode')"> <FormItem :label="l('departcode')" prop="departcode">
<Input v-model="entity.departcode" placeholder="请输入..."></Input> <Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
<!-- 组织类型 --> <!-- 组织类型 -->
...@@ -58,6 +60,18 @@ export default { ...@@ -58,6 +60,18 @@ export default {
name: "Add", name: "Add",
// components: { OrganizType }, // components: { OrganizType },
data() { data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.isExist(value).then((r) => {
if (r.result) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return { return {
// showTree: false, //组织类型 // showTree: false, //组织类型
disabled: false, disabled: false,
...@@ -67,28 +81,31 @@ export default { ...@@ -67,28 +81,31 @@ export default {
// organizationType: "" // organizationType: ""
departcode: "", departcode: "",
title02: "", title02: "",
}, },
property: [], property: [],
location: [], location: [],
rules: { rules: {
title02: [ title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" } { required: true, message: "名称不能为空", trigger: "blur" },
], ],
organizationType: [ organizationType: [
{ {
// type: 'array', // type: 'array',
required: true, required: true,
message: "组织类型不能为空", message: "组织类型不能为空",
trigger: "blur" trigger: "blur",
} },
] ],
} departcode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
}; };
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs["form"].validate(value => { this.$refs["form"].validate((value) => {
if (value) { if (value) {
let isProduction = 0; let isProduction = 0;
let property = []; let property = [];
...@@ -109,17 +126,17 @@ export default { ...@@ -109,17 +126,17 @@ export default {
} }
let location = this.location; let location = this.location;
let paramsdata = { let paramsdata = {
parentTitle:'', parentTitle: "",
name: this.entity.title02, //部门名称 name: this.entity.title02, //部门名称
parent_Id: 0, //上级部门 [id] parent_Id: 0, //上级部门 [id]
code: this.entity.departcode, //部门编号 code: this.entity.departcode, //部门编号
organization_Id: this.entity.organization_Id, //组织类型 [id] organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location.join(","), //省市县 location: location.join(","), //省市县
isProduction: isProduction, //是否生产班组:1是,0否 isProduction: isProduction, //是否生产班组:1是,0否
property: property.join(",") //属性 property: property.join(","), //属性
}; };
Api.create(paramsdata) Api.create(paramsdata)
.then(r => { .then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功!"); this.$Message.success("保存成功!");
...@@ -128,7 +145,7 @@ export default { ...@@ -128,7 +145,7 @@ export default {
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
}); });
...@@ -144,7 +161,7 @@ export default { ...@@ -144,7 +161,7 @@ export default {
l(key) { l(key) {
key = "DipartLocation" + "." + key; key = "DipartLocation" + "." + key;
return this.$t(key); return this.$t(key);
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -20,5 +20,8 @@ export default { ...@@ -20,5 +20,8 @@ export default {
departImport(params) { departImport(params) {
return Api.post(`${systemUrl}/departmentimport/import`, params); return Api.post(`${systemUrl}/departmentimport/import`, params);
}, },
// 编号是否存在
isExist(value) {
return Api.post(`${systemUrl}/Department/IsExist`, value);
},
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('departcode')"> <FormItem :label="l('departcode')" prop="code">
<Input v-model="entity.code" placeholder="请输入..."></Input> <Input v-model="entity.code" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -72,7 +72,8 @@ export default { ...@@ -72,7 +72,8 @@ export default {
id: -1 id: -1
}, },
rules: { rules: {
name: [{ required: true, message: "库位名不能为空", trigger: "blur" }], name: [{ required: true, message: "不能为空", trigger: "blur" }],
code: [{ required: true, message: "不能为空", trigger: "blur" }],
property: [ property: [
{ {
required: true, required: true,
......
...@@ -353,12 +353,38 @@ export default { ...@@ -353,12 +353,38 @@ export default {
}); });
list.forEach((e) => { list.forEach((e) => {
//给导出数据增加数据字典对应的name //给导出数据增加数据字典对应的name
tempCol.forEach((ele) => { tempCol.forEach((elem) => {
e[ele.key] = this.$u.dirName( if (
this.$store.getters.dictionaryByKey(ele.code), e[elem.key] &&
e[ele.key] e[elem.key] != "" &&
); e[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = e[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
e[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
e[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirName(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
}); });
tempCol1.forEach((ele1) => { tempCol1.forEach((ele1) => {
e[ele1.key] = this.getCityName(e[ele1.key]); e[ele1.key] = this.getCityName(e[ele1.key]);
}); });
...@@ -399,7 +425,7 @@ export default { ...@@ -399,7 +425,7 @@ export default {
parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id] parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id]
code: ele.code ? ele.code : '', //部门编号 code: ele.code ? ele.code : '', //部门编号
location: ele.location ? this.getCityValue(ele.location) : '', //省市县 location: ele.location ? this.getCityValue(ele.location) : '', //省市县
isProduction: 0, //是否生产班组:1是,0否 isProduction: ele.property.indexOf('1') > -1 && ele.property.indexOf('2') > -1 && ele.property.indexOf('3') > -1 ? 1 : 0, //是否生产班组:1是,0否. 属性值为三个值同时选择,则是生产班组
property: ele.property ? ele.property : '' //属性 property: ele.property ? ele.property : '' //属性
}; };
if (ele.name && ele.name != '') { if (ele.name && ele.name != '') {
......
...@@ -72,6 +72,11 @@ ...@@ -72,6 +72,11 @@
<FormItem :label="l('property')"> <FormItem :label="l('property')">
<Checkbox v-model="entity.property">排产资源</Checkbox> <Checkbox v-model="entity.property">排产资源</Checkbox>
</FormItem> </FormItem>
</Col>
<Col :span="12">
<FormItem label="用户类型">
<Dictionary code="User.base.UserType" v-model="entity.userType"></Dictionary>
</FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('remark')" prop="remark"> <FormItem :label="l('remark')" prop="remark">
......
...@@ -10,14 +10,13 @@ ...@@ -10,14 +10,13 @@
</div> </div>
</Sider> </Sider>
<Content class="content"> <Content class="content">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" placeholder="请输入姓名/员工编号" :high="true" :height="tdHeight"> <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" placeholder="请输入姓名/员工编号" exportTitle="用户管理" :high="true" :height="tdHeight">
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button> <Button type="primary" @click="addModal=true">新增</Button>
<Button @click="import2Excel">导入</Button> <Button @click="openModalIm">导入</Button>
<Button @click="export2Excel">导出</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="addModal" title="新增" footer-hide width="800"> <Modal v-model="addModal" title="新增" footer-hide width="800">
...@@ -76,17 +75,7 @@ ...@@ -76,17 +75,7 @@
<Modal v-model="syncAccountModal" title="同步账户" @on-ok="syncAccountOk" @on-cancel="cancel"> <Modal v-model="syncAccountModal" title="同步账户" @on-ok="syncAccountOk" @on-cancel="cancel">
<p>确定同步账户?</p> <p>确定同步账户?</p>
</Modal> </Modal>
<Modal v-model="modalImport" title="导入excel" fullscreen hidefooter> <ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Button icon="ios-cloud-upload-outline">上传Excel文件</Button>
</Upload>
<DataGrid border :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :tool="false" :page="false" :set="false"></DataGrid>
<div slot="footer">
<span v-if="excelData.length>0">共 {{excelData.length}} 条数据</span>
<Button @click="cancelExcel">取消</Button>
<Button type="primary" @click="importOk">确定导入</Button>
</div>
</Modal>
</Content> </Content>
</Layout> </Layout>
</template> </template>
...@@ -205,6 +194,7 @@ export default { ...@@ -205,6 +194,7 @@ export default {
align: "center", align: "center",
high: true, high: true,
code: "User.base.gender", code: "User.base.gender",
import: true,
}, },
{ {
key: "birthday", key: "birthday",
...@@ -212,6 +202,7 @@ export default { ...@@ -212,6 +202,7 @@ export default {
align: "center", align: "center",
high: true, high: true,
type: "date", type: "date",
import: true,
}, },
{ {
key: "degreeId", key: "degreeId",
...@@ -219,6 +210,7 @@ export default { ...@@ -219,6 +210,7 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "User.base.degree", code: "User.base.degree",
import: true,
}, },
{ {
key: "status", key: "status",
...@@ -226,6 +218,7 @@ export default { ...@@ -226,6 +218,7 @@ export default {
align: "center", align: "center",
high: true, high: true,
code: "User.base.status", code: "User.base.status",
import: true,
}, },
{ {
key: "departmentId", key: "departmentId",
...@@ -233,6 +226,7 @@ export default { ...@@ -233,6 +226,7 @@ export default {
align: "right", align: "right",
easy: true, easy: true,
high: true, high: true,
import: true,
}, },
{ {
key: "departmentTitle", key: "departmentTitle",
...@@ -240,6 +234,7 @@ export default { ...@@ -240,6 +234,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
import: true,
}, },
{ {
...@@ -277,6 +272,7 @@ export default { ...@@ -277,6 +272,7 @@ export default {
title: this.l("accountId"), title: this.l("accountId"),
hide: true, hide: true,
align: "left", align: "left",
import: true,
}, },
// { // {
// key: 'userType', // key: 'userType',
...@@ -290,6 +286,7 @@ export default { ...@@ -290,6 +286,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
import: true,
}, },
{ {
key: "email", key: "email",
...@@ -297,12 +294,14 @@ export default { ...@@ -297,12 +294,14 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
import: true,
}, },
{ {
key: "licensedToWork", key: "licensedToWork",
title: this.l("licensedToWork"), title: this.l("licensedToWork"),
align: "left", align: "left",
code: "User.base.workLicense", code: "User.base.workLicense",
import: true,
}, },
{ {
key: "positionId", key: "positionId",
...@@ -310,6 +309,7 @@ export default { ...@@ -310,6 +309,7 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "User.base.position", code: "User.base.position",
import: true,
}, },
{ {
key: "titleId", key: "titleId",
...@@ -317,6 +317,7 @@ export default { ...@@ -317,6 +317,7 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "User.base.jobtitle", code: "User.base.jobtitle",
import: true,
}, },
{ {
key: "creatorUserId", key: "creatorUserId",
...@@ -324,6 +325,8 @@ export default { ...@@ -324,6 +325,8 @@ export default {
align: "left", align: "left",
import: false, import: false,
hide: true, hide: true,
import: true,
type: 'user'
}, },
{ {
key: "creationTime", key: "creationTime",
...@@ -331,6 +334,7 @@ export default { ...@@ -331,6 +334,7 @@ export default {
align: "left", align: "left",
import: false, import: false,
hide: true, hide: true,
import: true,
}, },
{ {
key: "lastModifierUserId", key: "lastModifierUserId",
...@@ -338,6 +342,8 @@ export default { ...@@ -338,6 +342,8 @@ export default {
align: "left", align: "left",
import: false, import: false,
hide: true, hide: true,
import: true,
type: 'user'
}, },
{ {
key: "lastModificationTime", key: "lastModificationTime",
...@@ -345,6 +351,7 @@ export default { ...@@ -345,6 +351,7 @@ export default {
align: "left", align: "left",
import: false, import: false,
hide: true, hide: true,
import: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -419,6 +426,8 @@ export default { ...@@ -419,6 +426,8 @@ export default {
departArr: [], //部门list departArr: [], //部门list
columnsImport: [], columnsImport: [],
temTitle: '用户管理',
ModalIm: false,
//导入导出时使用end //导入导出时使用end
}; };
}, },
...@@ -676,287 +685,53 @@ export default { ...@@ -676,287 +685,53 @@ export default {
} }
}, },
//同步账户end //同步账户end
//导出excel
export2Excel() {
//当前显示数据
var where = [];
var conditions = this.easySearch;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range") {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
}
});
}
this.searchs.pageIndex = 1;
this.searchs.conditions = where;
this.searchs.pageSize = 1000;
this.$api.post(this.action, this.searchs).then((r) => {
this.list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var columnsCur = this.$u.clone(this.columns); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if ((el.hide && !el.import) || (!el.hide && el.key != "action")) {
if (el.code) {
//tHeader.push(el.key + "DirName");
//filterVal.push(el.key + "DirName");
//tempCol.push({ key: el.key + "DirName", code: el.code }); //临时存放code数据字典的字段及对应的数据字典code
tempCol.push({
key: el.key,
code: el.code
}); //临时存放code数据字典的字段及对应的数据字典code
}
tHeader.push(this.l(el.key));
filterVal.push(el.key);
}
});
this.list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
});
});
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this.$u.outExcel(
"用户管理(" + nowDate + ")",
tHeader,
filterVal,
this.list
);
});
},
//导入excel //导入excel
//打开弹出层 //导入功能
import2Excel() { openModalIm() {
this.modalImport = true; this.ModalIm = true
this.excelData = [];
this.$refs.uploadfile.clearFiles();
ApiDepart.getpaged().then((r) => {
this.departArr = r.result.items;
});
}, },
//导入excel文件 ModalImCancel() {
async beforeUpload(file) { this.ModalIm = false
this.excelData = []; },
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表 ok() {
var tempColums = this.$u.clone(this.columnsImport); this.$refs.grid.load();
const workbook = await this.$u.readXLSX(file); },
const sheet2JSONOpts = { getData(val) {
defval: "", //给defval赋值为空的字符串 let url = `${systemUrl}/userimportservice/import`;
}; this.$refs.importExcel.deelData(url, this.columns, this.formatMethod(val))
var csv = XLSX.utils.sheet_to_csv(
workbook.Sheets[workbook.SheetNames[0]],
sheet2JSONOpts
);
var lines = csv.split("\n"); //第一行标题
var headers = lines[0].split(",");
var arrTi = [];
//转换到colum后的list表头start
headers.forEach((elHead) => {
tempColums.forEach((elCol) => {
if (elHead == elCol.title) {
//elHead=elCol.key
arrTi.push(elCol.key);
}
});
});
headers = arrTi;
//转换到colum后的list表头end
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
//对读取的excel文件数据进行处理
var arrTitleUse = []; //使用数据字典的字段
tempColums.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code
});
}
});
result.forEach((ele) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
ele.departmentTitle &&
ele.departmentTitle != "" &&
(!ele.departmentId || ele.departmentId == "")
) {
this.departArr.forEach((e) => {
if (ele.departmentTitle && ele.departmentTitle == e.name) {
ele.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
ele.departmentId &&
ele.departmentId + "" != "" &&
(!ele.departmentTitle || ele.departmentTitle == "")
) {
this.departArr.forEach((e) => {
if (ele.departmentId && ele.departmentId == e.id) {
ele.departmentTitle = e.name;
}
});
}
//对列表里的数据字典项进行处理
arrTitleUse.forEach((elem) => {
if (ele[elem.key] && ele[elem.key] != "" && ele[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
ele[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
ele[elem.key]
);
}
});
});
this.excelData = result;
//console.log(workbook);
return false;
}, },
//确定批量导入 //根据页面二次处理数据
importOk() { formatMethod(val) {
let tempData = this.$u.clone(this.excelData); let tempData = this.$u.clone(val);
let tempList = []; let tempList = [];
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
userName: ele.userName, userName: ele.userName ? ele.userName : '',
cardNo: ele.cardNo, cardNo: ele.cardNo ? ele.cardNo : '', //用户编号
gender: ele.gender, gender: ele.gender ? ele.gender : '', //性别
birthday: ele.birthday, birthday: ele.birthday ? ele.birthday : '',
degreeId: ele.degreeId, degreeId: ele.degreeId ? ele.degreeId : '',
departmentId: ele.departmentId, departmentId: ele.departmentId ? ele.departmentId : null,
status: ele.status, status: ele.status ? ele.status : null,
phone: ele.phone, phone: ele.phone ? ele.phone : '',
email: ele.email, email: ele.email ? ele.email : '',
licensedToWork: ele.licensedToWork, licensedToWork: ele.licensedToWork ? ele.licensedToWork : null,
positionId: ele.positionId, positionId: ele.positionId ? ele.positionId : null,
titleId: ele.titleId, titleId: ele.titleId ? ele.titleId : null,
departmentTitle: ele.departmentTitle, departmentTitle: ele.departmentTitle ? ele.departmentTitle : '',
}; };
tempList.push(obj); if (ele.userName && ele.userName != '' && ele.cardNo && ele.cardNo != '' && ele.departmentId && ele.departmentId != null && ele.phone && ele.phone != '') {
}); obj.ico = false
let parms = {
list: tempList,
};
Api.userImport(parms).then((res) => {
if (res.success) {
this.$Message.success("批量导入成功!");
this.$refs.grid.load();
this.cancelExcel();
} else { } else {
this.$Message.error("批量导入失败!"); obj.ico = true
}
});
},
//取消导入excel
cancelExcel() {
this.modalImport = false;
this.excelData = [];
this.$refs.uploadfile.clearFiles();
},
//旧方法,设置dirname,通过取excel第一行的数据定义colums
async beforeUploadOld(file) {
this.excelData = [];
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
const workbook = await this.$u.readXLSX(file);
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var tempList = XLSX.utils.sheet_to_json(
workbook.Sheets[workbook.SheetNames[0]],
sheet2JSONOpts
);
//对读取的excel文件数据进行处理
var tempColums = this.$u.clone(this.columnsImport);
var arrTitles = Object.keys(tempList[0]); //获取列表title
var arrTitleUse = []; //使用数据字典的字段
tempColums.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code
});
}
});
tempList.forEach((ele) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
ele.departmentTitle &&
ele.departmentTitle != "" &&
(!ele.departmentId || ele.departmentId == "")
) {
this.departArr.forEach((e) => {
if (ele.departmentTitle && ele.departmentTitle == e.name) {
ele.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
ele.departmentId &&
ele.departmentId + "" != "" &&
(!ele.departmentTitle || ele.departmentTitle == "")
) {
this.departArr.forEach((e) => {
if (ele.departmentId && ele.departmentId == e.id) {
ele.departmentTitle = e.name;
}
});
} }
tempList.push(obj);
//对列表里的数据字典项进行处理
arrTitleUse.forEach((elem) => {
if (ele[elem.key] && ele[elem.key] != "" && ele[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
ele[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
ele[elem.key]
);
}
});
}); });
return tempList
this.excelData = tempList;
console.log(workbook);
return false;
}, },
//批量导入end
}, },
computed: { computed: {
searchList() { searchList() {
......
<template> <template>
<div class="detail"> <div class="detail">
<Row>
<Row> <!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed> <Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed> <Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed> <Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed> <Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed> <Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> --> <Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> -->
<Filed :span="12" :name="l('timestamp')">{{entity.timestamp}}</Filed> <Filed :span="12" :name="l('timestamp')">{{ entity.timestamp }}</Filed>
<Filed :span="12" :name="l('level')">{{entity.level}}</Filed> <Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
<!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> --> <!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> -->
<Filed :span="12" :name="l('renderedMessage')">{{entity.renderedMessage}}</Filed> <Filed :span="12" :name="l('renderedMessage')">{{
<Filed :span="12" :name="l('clientIpAddress')">{{entity.clientIpAddress}}</Filed> entity.renderedMessage
<Filed :span="12" :name="l('loginName')">{{entity.loginName}}</Filed> }}</Filed>
<Filed :span="12" :name="l('tanentCode')">{{entity.tanentCode}}</Filed> <Filed :span="12" :name="l('clientIpAddress')">{{
<Filed :span="12" :name="l('host')">{{entity.host}}</Filed> entity.clientIpAddress
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed> }}</Filed>
<Filed :span="12" :name="l('requestUrl')">{{entity.requestUrl}}</Filed> <Filed :span="12" :name="l('loginName')">{{ entity.loginName }}</Filed>
<Filed :span="12" :name="l('requestParam')">{{entity.requestParam}}</Filed> <Filed :span="12" :name="l('tanentCode')">{{ entity.tanentCode }}</Filed>
<Filed :span="24" :name="l('exception')">{{entity.exception}}</Filed> <Filed :span="12" :name="l('host')">{{ entity.host }}</Filed>
</Row> <Filed :span="12" :name="l('status')">{{ entity.status }}</Filed>
</div> <Filed :span="12" :name="l('requestUrl')">{{ entity.requestUrl }}</Filed>
<Filed :span="12" :name="l('requestParam')">{{
entity.requestParam
}}</Filed>
<Filed :span="24" :name="l('exception')">{{ entity.exception }}</Filed>
</Row>
<Form
class="form"
ref="form"
:model="entity"
:rules="rules"
:label-width="90"
>
<Row>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="error.status"
v-model="entity.status"
type="radio"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
entity: {}, entity: {
rules: { exception: "",
name: [{ required: true, message: '必填', trigger: 'blur' }], properties: {},
code: [{ required: true, message: '必填', trigger: 'blur' }] status: 0,
} },
} rules: {
}, name: [{ required: true, message: "必填", trigger: "blur" }],
props: { code: [{ required: true, message: "必填", trigger: "blur" }],
eid: Number },
}, disabled: false,
mounted() { };
if (this.eid) { },
this.load(this.eid); props: {
} eid: "",
}, },
methods: { mounted() {
load(v) { if (this.eid) {
Api.get({ id: v }).then(r => { this.load(this.eid);
this.entity = r.result;
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "run_log" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
} }
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
if (r.result.status == "" || r.result.status == null) {
r.result.status = 0;
}
this.entity = r.result;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "run_log" + "." + key;
return this.$t(key);
},
handleSubmit() {
this.disabled = true;
Api.update({
id: this.entity.id,
status: this.entity.status,
remark: this.entity.remark,
})
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
cosole.warn(err);
});
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script> </script>
\ No newline at end of file
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
exportTitle="异常记录"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字登录账号/租户编号" v-model="easySearch.keys.value" v-width="300"/> <Input
placeholder="请输入关键字登录账号/租户编号"
v-model="easySearch.keys.value"
v-width="300"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -15,7 +24,12 @@ ...@@ -15,7 +24,12 @@
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<DatePicker type="date" v-model="end" placeholder="选择终止日期" style="width: 150px"></DatePicker> <DatePicker
type="date"
v-model="end"
placeholder="选择终止日期"
style="width: 150px"
></DatePicker>
<Button type="error" @click="clear" :disabled="dis">清理</Button> <Button type="error" @click="clear" :disabled="dis">清理</Button>
</template> </template>
</DataGrid> </DataGrid>
...@@ -24,6 +38,7 @@ ...@@ -24,6 +38,7 @@
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
...@@ -41,9 +56,12 @@ export default { ...@@ -41,9 +56,12 @@ export default {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "loginName,tanentCode", value: null }, keys: {
op: "loginName,tanentCode",
value: null,
},
}, },
end:null, end: null,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
...@@ -124,8 +142,16 @@ export default { ...@@ -124,8 +142,16 @@ export default {
hide: true, hide: true,
high: true, high: true,
}, },
// { key:"status",title:this.l("status") ,align:"left" ,high:true }, {
key: "status",
title: this.l("status"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {}, params.row.status == 1 ? "已解决" : "未解决");
},
},
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{ {
key: "requestParam", key: "requestParam",
title: this.l("requestParam"), title: this.l("requestParam"),
...@@ -140,34 +166,48 @@ export default { ...@@ -140,34 +166,48 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h(
h( "div",
"op", {
{ class: "action",
attrs: { oprate: "detail" }, },
on: { click: () => this.view(params.row.id) }, [
}, h(
"查看" "op",
), {
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'), attrs: {
// h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'), oprate: "detail",
h( },
"op", on: {
{ click: () => this.view(params.row.id),
attrs: { oprate: "delete" }, },
on: { click: () => this.remove(params.row.id) }, },
}, "查看"
"删除" ),
), //h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
]); // h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h(
"op",
{
attrs: {
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
},
"删除"
),
]
);
}, },
}, },
], ],
}; };
}, },
created() { created() {
var date=new Date().getTime()-24*60*60*1000*5; var date = new Date().getTime() - 24 * 60 * 60 * 1000 * 5;
this.end=new Date(date); this.end = new Date(date);
console.log(this); console.log(this);
}, },
...@@ -215,21 +255,21 @@ export default { ...@@ -215,21 +255,21 @@ export default {
} }
}); });
}, },
clear(){ clear() {
this.$Modal.confirm({ this.$Modal.confirm({
title:"确认", title: "确认",
content:"确认要删除"+this.$u.toDate(this.end) +"以前的数据吗", content: "确认要删除" + this.$u.toDate(this.end) + "以前的数据吗",
onOk:()=>{ onOk: () => {
Api.deleteAll(this.end).then(r=>{ Api.deleteAll(this.end).then((r) => {
if(r.success){ if (r.success) {
this.$Message.success("删除成功") this.$Message.success("删除成功");
this.$refs.grid.load(); this.$refs.grid.load();
}else{ } else {
this.$Message.error("出现异常") this.$Message.error("出现异常");
}
})
} }
}) });
},
});
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
...@@ -237,39 +277,41 @@ export default { ...@@ -237,39 +277,41 @@ export default {
}, },
l(key) { l(key) {
/* /*
run_log:{ run_log:{
creationTime:'创建时间', creationTime:'创建时间',
creatorUserId:'创建人', creatorUserId:'创建人',
lastModificationTime:'更新时间', lastModificationTime:'更新时间',
lastModifierUserId:'更新人', lastModifierUserId:'更新人',
isDeleted:'删除人', isDeleted:'删除人',
deletionTime:'删除时间', deletionTime:'删除时间',
deleterUserId:'删除人', deleterUserId:'删除人',
timestamp:'异常发生时间', timestamp:'异常发生时间',
level:'日志级别', level:'日志级别',
messageTemplate:'消息模板', messageTemplate:'消息模板',
renderedMessage:'异常信息', renderedMessage:'异常信息',
clientIpAddress:'客户端IP', clientIpAddress:'客户端IP',
loginName:'登录账号', loginName:'登录账号',
tanentCode:'租户编号', tanentCode:'租户编号',
host:'主机IP', host:'主机IP',
status:'状态', status:'状态',
requestUrl:'服务地址', requestUrl:'服务地址',
requestParam:'参数', requestParam:'参数',
exception:'异常详细信息', exception:'异常详细信息',
} }
*/ */
let vkey = "run_log" + "." + key; let vkey = "run_log" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
}, },
}, },
computed:{ computed: {
dis(){ dis() {
var num=(new Date().getTime()-this.end.getTime())/(1000*60*60*24); var num =
return num<1 (new Date().getTime() - this.end.getTime()) / (1000 * 60 * 60 * 24);
} return num < 1;
} },
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -4,12 +4,4 @@ ...@@ -4,12 +4,4 @@
<h2>欢迎登陆!</h2> <h2>欢迎登陆!</h2>
</div> </div>
</template> </template>
<script> \ No newline at end of file
// import iview from './crm/statistical/index.vue'
export default {
// components: {
// iview
// }
}
</script>
\ No newline at end of file
<template> <template>
<div class="config flex"> <div class="config flex">
<div class="menu"> <div class="menu">
<Menu theme="light" active-name="site"> <Menu theme="light" active-name="site" @on-select="pageTo">
<MenuItem name="site" to="#site">站点设置</MenuItem> <MenuItem name="site">站点设置</MenuItem>
<MenuItem name="bus" to="#bus">业务设置</MenuItem> <MenuItem name="bus">业务设置</MenuItem>
</Menu> </Menu>
</div> </div>
<div class="main fg"> <div class="main fg" id="mainDiv">
<div class="tool tr"> <div class="tr lt40 fr divTop pr20">
<Button type="primary" size="small" @click="save">保存</Button> <Button type="primary" size="small" @click="save">保存</Button>
<Button type="text">恢复默认</Button> <Button type="text" size="small" @click="reset">恢复默认</Button>
</div>
<Form ref="form" :model="config" :rules="rules" :label-width="120">
<div id="site">
<h3>站点设置</h3>
<FormItem label="默认语言" prop="site.language">
<Input v-model="config.site.language"></Input>
</FormItem>
<FormItem label="默认密码" prop="site.password">
<Input v-model="config.site.password"></Input>
</FormItem>
<FormItem label="密码规则" prop="site.password">
<RadioGroup v-model="config.site.passwordRule">
<Radio :label="0">简易</Radio>
<Radio :label="1">中级 <span class="tip"> 密码长度6位以上</span></Radio>
<Radio :label="2">高级
<span class="tip"> 密码需要包含数字字母和特殊字符,长度8位以上</span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem label="密码安全校验">
<i-switch v-model="config.site.loginEditPassword"/>
<span class="tip">开启后,用户密码安全级别低时,登陆后强制修改密码</span>
</FormItem>
<FormItem label="验证码">
<i-switch v-model="config.site.loginCode" />
<span class="tip">开启后用户登陆需要输入验证码</span>
</FormItem>
<FormItem label="注册邀请码">
<Input v-model="config.site.regCode" ></Input>
<span class="tip">1.为空时:不对外开放注册;2.设置为“666”时用户免输入注册邀请码就可以进行注册;3.其它情况,注册时需要输入注册邀请码</span>
</FormItem>
<FormItem label="登陆有效期">
<InputNumber v-model="config.site.loginValidHoure" :min="1" :max="2400"></InputNumber>
<span class="tip">单位为小时,设置后用户登陆此时长后自动过期</span>
</FormItem>
<FormItem label="Bug反馈">
<i-switch v-model="config.site.bug" />
<span class="tip">开启后,用户可以提交bug并管理自己的bug</span>
</FormItem>
<FormItem label="异常管理">
<i-switch v-model="config.site.exception" />
<span class="tip">开启后可以查看系统异常</span>
</FormItem>
<FormItem label="异常消息">
<Input v-model="config.site.exceptionMessage" ></Input>
<span class="tip">设置后,接口发生异常,统一返回次内容。为空时返回系统异常</span>
</FormItem>
<FormItem label="列表显示方式">
<RadioGroup v-model="config.site.gridType">
<Radio :label="0">表格</Radio>
<Radio :label="1">卡片</Radio>
<!-- <Radio label="2">无限下拉</Radio> -->
</RadioGroup>
</FormItem>
<FormItem label="默认分页大小">
<Select v-model="config.site.pageSize">
<Option :value="20">每页20条</Option>
<Option :value="50">每页50条</Option>
<Option :value="100">每页100条</Option>
</Select>
</FormItem>
<FormItem label="弹窗宽度">
<InputNumber v-model="config.site.windowWidth" :min="1" :max="2400"></InputNumber>
<span class="tip">设置弹窗页面宽度</span>
</FormItem>
<FormItem label="弹窗移动">
<i-switch v-model="config.site.windowMove" />
<span class="tip">开启后弹框可以进行移动</span>
</FormItem>
</div> </div>
<div id="bus"> <Form ref="form" :model="config" :rules="rules" :label-width="120">
<h3>业务设置</h3> <div id="site" class="mt50">
<FormItem label="订单开工预警"> <h3>站点设置</h3>
<InputNumber v-model="config.bus.orderStartWarning" :min="0" :max="2400"/> <FormItem label="默认语言" prop="site.language">
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <Input v-model="config.site.language"></Input>
</FormItem> </FormItem>
<FormItem label="订单完工预警"> <FormItem label="默认密码" prop="site.password">
<InputNumber v-model="config.bus.orderFinishWarning" :min="0" :max="2400"/> <Input v-model="config.site.password"></Input>
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> </FormItem>
</FormItem> <FormItem label="密码规则" prop="site.password">
<FormItem label="工单开工预警"> <RadioGroup v-model="config.site.passwordRule">
<InputNumber v-model="config.bus.excuteStartWarning" :min="0" :max="2400"/> <Radio :label="0">简易</Radio>
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <Radio :label="1">中级 <span class="tip"> 密码长度6位以上</span></Radio>
</FormItem> <Radio :label="2">高级
<FormItem label="工单完工预警"> <span class="tip"> 密码需要包含数字字母和特殊字符,长度8位以上</span>
<InputNumber v-model="config.bus.excuteEndWarning" :min="0" :max="2400"/> </Radio>
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="库存预警"> <FormItem label="密码安全校验">
<i-switch v-model="config.site.storeWarning" /> <i-switch v-model="config.site.loginEditPassword" />
</FormItem> <span class="tip">开启后,用户密码安全级别低时,登陆后强制修改密码</span>
<FormItem label="多工艺"> </FormItem>
<i-switch v-model="config.bus.multipleHeader" /> <FormItem label="验证码">
<span class="tip">开启后,一个生产计划可以设置多本工艺规程</span> <i-switch v-model="config.site.loginCode" />
</FormItem> <span class="tip">开启后用户登陆需要输入验证码</span>
<FormItem label="按序执行"> </FormItem>
<i-switch v-model="config.bus.detailFirst" /> <FormItem label="注册邀请码">
<span class="tip">开启后,工单执行必须按照工序次序先后次序执行;关闭后,工单可以不按工序次序执行。</span> <Input v-model="config.site.regCode"></Input>
</FormItem> <span class="tip">1.为空时:不对外开放注册;2.设置为“666”时用户免输入注册邀请码就可以进行注册;3.其它情况,注册时需要输入注册邀请码</span>
<FormItem label="工艺设置预警"> </FormItem>
<InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400"/> <FormItem label="登陆有效期">
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <InputNumber v-model="config.site.loginValidHoure" :min="1" :max="2400"></InputNumber>
</FormItem> <span class="tip">单位为小时,设置后用户登陆此时长后自动过期</span>
<FormItem label="配套完成预警"> </FormItem>
<InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400"/> <FormItem label="Bug反馈">
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <i-switch v-model="config.site.bug" />
</FormItem> <span class="tip">开启后,用户可以提交bug并管理自己的bug</span>
<FormItem label="转序交接"> </FormItem>
<i-switch v-model="config.bus.excuteHandover" /> <FormItem label="异常管理">
<span class="tip">开启后,工单转序必须进行交接</span> <i-switch v-model="config.site.exception" />
</FormItem> <span class="tip">开启后可以查看系统异常</span>
<FormItem label="同车间转序交接"> </FormItem>
<i-switch v-model="config.bus.inenerExcuteHandover" /> <FormItem label="异常消息">
<span class="tip">开启后,同车间工单转序必须进行交接</span> <Input v-model="config.site.exceptionMessage"></Input>
</FormItem> <span class="tip">设置后,接口发生异常,统一返回次内容。为空时返回系统异常</span>
<FormItem label="配套前置"> </FormItem>
<i-switch v-model="config.site.suportingFirst" /> <FormItem label="列表显示方式">
<span class="tip">开启配套前置后,工单只有完成配套才可以进行开工</span> <RadioGroup v-model="config.site.gridType">
</FormItem> <Radio :label="0">表格</Radio>
</div> <Radio :label="1">卡片</Radio>
</Form> <!-- <Radio label="2">无限下拉</Radio> -->
</RadioGroup>
</FormItem>
<FormItem label="默认分页大小">
<Select v-model="config.site.pageSize">
<Option :value="20">每页20条</Option>
<Option :value="50">每页50条</Option>
<Option :value="100">每页100条</Option>
</Select>
</FormItem>
<FormItem label="弹窗宽度">
<InputNumber v-model="config.site.windowWidth" :min="1" :max="2400"></InputNumber>
<span class="tip">设置弹窗页面宽度</span>
</FormItem>
<FormItem label="弹窗移动">
<i-switch v-model="config.site.windowMove" />
<span class="tip">开启后弹框可以进行移动</span>
</FormItem>
</div>
<div id="bus">
<h3>业务设置</h3>
<FormItem label="订单开工预警">
<InputNumber v-model="config.bus.orderStartWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem>
<FormItem label="订单完工预警">
<InputNumber v-model="config.bus.orderFinishWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem>
<FormItem label="工单开工预警">
<InputNumber v-model="config.bus.excuteStartWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem>
<FormItem label="工单完工预警">
<InputNumber v-model="config.bus.excuteEndWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem>
<FormItem label="库存预警">
<i-switch v-model="config.site.storeWarning" />
</FormItem>
<FormItem label="多工艺">
<i-switch v-model="config.bus.multipleHeader" />
<span class="tip">开启后,一个生产计划可以设置多本工艺规程</span>
</FormItem>
<FormItem label="按序执行">
<i-switch v-model="config.bus.detailFirst" />
<span class="tip">开启后,工单执行必须按照工序次序先后次序执行;关闭后,工单可以不按工序次序执行。</span>
</FormItem>
<FormItem label="工艺设置预警">
<InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem>
<FormItem label="配套完成预警">
<InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem>
<FormItem label="转序交接">
<i-switch v-model="config.bus.excuteHandover" />
<span class="tip">开启后,工单转序必须进行交接</span>
</FormItem>
<FormItem label="同车间转序交接">
<i-switch v-model="config.bus.inenerExcuteHandover" />
<span class="tip">开启后,同车间工单转序必须进行交接</span>
</FormItem>
<FormItem label="配套前置">
<i-switch v-model="config.site.suportingFirst" />
<span class="tip">开启配套前置后,工单只有完成配套才可以进行开工</span>
</FormItem>
</div>
</Form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import config from "~/libs/config"; //import config from "~/libs/config";
export default { export default {
name: "", name: "",
data() { data() {
return { return {
config: config, config: this.$store.state.siteConfig,
rules: {}, rules: {},
}; };
}, },
methods: { async fetch({
save() {}, store,
reset() {}, params
}, }) {
await store.dispatch('loadSiteConfig') // 加载默认数据
},
mounted() {},
methods: {
//保存设置
save() {
this.$store.dispatch('saveConfig', this.config)
},
//恢复默认
reset() {
this.config = this.$store.state.defaultConfig; //重置为默认设置信息
let configTemSite = this.$store.state.siteConfig; //获取组合设置信息
if (configTemSite.tenantCode != '') {
this.config.tenantCode = configTemSite.tenantCode
}
},
//menu切换
pageTo(val) {
var mainDiv = document.getElementById('mainDiv');
var site = document.getElementById('site');
if (val == 'site') {
mainDiv.scrollTop = 0;
} else {
mainDiv.scrollTop = site.scrollHeight;
}
}
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
.config { .config {
height: 100%; height: 100%;
.menu {
width: 240px; .menu {
border-right: 1px solid #ddd; width: 240px;
position: relative; border-right: 1px solid #ddd;
.ivu-menu{ position: relative;
z-index: 10;
position: absolute; .ivu-menu {
width: 100%; z-index: 10;
top:5px; position: absolute;
} width: 100%;
} top: 5px;
.main { }
margin: 0px -10px;
padding: 10px 20px;
h3 {
font-size: 16px;
} }
.tip{
font-size: 13px; .main {
color: #999; margin: 0px -10px;
font-style: italic; padding: 10px 20px;
h3 {
font-size: 16px;
}
.tip {
font-size: 13px;
color: #999;
font-style: italic;
}
.divTop {
position: fixed;
background: #fff;
height: 40px;
width: calc(~'100% - 560px');
z-index: 100;
border-bottom: 1px #e4e6ed solid;
top: 105px
}
height: calc(100vh - 150px);
overflow-y: auto;
} }
height: calc(100vh - 150px);
overflow-y: auto;
}
} }
</style> </style>
\ No newline at end of file
...@@ -53,7 +53,7 @@ function errorLog (err) { ...@@ -53,7 +53,7 @@ function errorLog (err) {
// 创建一个 axios 实例 // 创建一个 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
timeout: 5000, // 请求超时时间 timeout: 30000, // 请求超时时间
transformRequest:[(data)=>{ transformRequest:[(data)=>{
function dateFormat(date, fmt) { function dateFormat(date, fmt) {
if (null == date || undefined == date) return ''; if (null == date || undefined == date) return '';
......
...@@ -8,6 +8,46 @@ html body { ...@@ -8,6 +8,46 @@ html body {
#__layout { #__layout {
height: 100%; height: 100%;
} }
/*flex*/
.flex {
display: flex;
}
.fc-m {
justify-content: center;
}
.fa-m {
align-items: center;
}
.fc-e {
justify-content: flex-end;
}
.fc-b {
justify-content: space-between;
}
.fc-a {
justify-content: space-around;
}
.fc-ev {
justify-content: space-evenly;
}
.fd {
flex-direction: column;
}
.fg {
flex-grow: 1;
}
.fs {
flex-shrink: 0;
}
.fg2 {
flex-grow: 2;
}
.fos {
order: -1;
}
.foe {
order: 99;
}
/*字体*/ /*字体*/
.ib { .ib {
display: inline; display: inline;
...@@ -172,6 +212,12 @@ html body { ...@@ -172,6 +212,12 @@ html body {
.pl20 { .pl20 {
padding-left: 20px; padding-left: 20px;
} }
.pr10 {
padding-right: 10px;
}
.pr20 {
padding-right: 20px;
}
.bnone { .bnone {
border: none; border: none;
} }
...@@ -475,6 +521,15 @@ i.icon-gengxin { ...@@ -475,6 +521,15 @@ i.icon-gengxin {
.tc { .tc {
text-align: center; text-align: center;
} }
.lt30 {
line-height: 30px;
}
.lt40 {
line-height: 40px;
}
.lt50 {
line-height: 50px;
}
/*清除浮动*/ /*清除浮动*/
.clear { .clear {
clear: both; clear: both;
...@@ -523,6 +578,7 @@ textarea::-webkit-input-placeholder { ...@@ -523,6 +578,7 @@ textarea::-webkit-input-placeholder {
background: #fff; background: #fff;
padding: 0px 10px 20px 10px; padding: 0px 10px 20px 10px;
margin-top: 10px; margin-top: 10px;
overflow: auto;
} }
.zh-tree .zh-title { .zh-tree .zh-title {
font-size: 14px; font-size: 14px;
...@@ -646,7 +702,7 @@ html [type=button] { ...@@ -646,7 +702,7 @@ html [type=button] {
} }
.waitTask { .waitTask {
/*flex 布局*/ /*flex 布局*/
display: flex; display: flex!important;
align-items: center; align-items: center;
width: 200px; width: 200px;
height: 100px; height: 100px;
...@@ -892,7 +948,6 @@ html [type=button] { ...@@ -892,7 +948,6 @@ html [type=button] {
color: #249e91; color: #249e91;
} }
.full .menu .tree { .full .menu .tree {
height: calc(100% - 150px);
overflow: auto; overflow: auto;
} }
.full .content { .full .content {
...@@ -922,3 +977,7 @@ html [type=button] { ...@@ -922,3 +977,7 @@ html [type=button] {
.content { .content {
padding-left: 5px; padding-left: 5px;
} }
.row_border_bottom {
border-bottom: 1px solid #E0E0E0;
padding: 15px 20px;
}
...@@ -10,6 +10,7 @@ let address=systemApi.dev; ...@@ -10,6 +10,7 @@ let address=systemApi.dev;
//let address=systemApi.local; //let address=systemApi.local;
window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据) window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据)
// window.systemUrl = `http://localhost:10020/api/services/app`; //System-api 系统管理(基础数据)
window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证 window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证
window.UserUrl = `http://${address}:10130`; //Authentication-api //用户信息 密码修改。重置等 window.UserUrl = `http://${address}:10130`; //Authentication-api //用户信息 密码修改。重置等
window.designUrl = `http://${address}:10000/process`; // 工艺规程 window.designUrl = `http://${address}:10000/process`; // 工艺规程
......
import createVuexAlong from 'vuex-along' import createVuexAlong from 'vuex-along'
import Api from '@/plugins/request' import Api from '@/plugins/request'
import util from '@/libs/util';
export const state = () => ({ export const state = () => ({
counter: 0, counter: 0,
dictionary: new Map(), //所有字典项 dictionary: new Map(), //所有字典项
...@@ -11,6 +12,8 @@ export const state = () => ({ ...@@ -11,6 +12,8 @@ export const state = () => ({
}, },
siteConfig: {}, siteConfig: {},
defaultConfig: {}, defaultConfig: {},
configId:null,
configSaveStatu:0,
}) })
export const getters = { export const getters = {
dictionaryByKey: (state) => (key) => { dictionaryByKey: (state) => (key) => {
...@@ -56,10 +59,16 @@ export const mutations = { ...@@ -56,10 +59,16 @@ export const mutations = {
state.dictionary = dictionary; state.dictionary = dictionary;
}, },
setSiteConfig(state, config) { setSiteConfig(state, config) {
state.siteConfig = config; state.siteConfig = JSON.parse(config);
}, },
setDefaultConfig(state, config) { setDefaultConfig(state, config) {
state.defaultConfig = config; state.defaultConfig =JSON.parse(config);
},
setConfigId(state, id) {
state.configId =id;
},
setConfigSaveStatu(state, val) {
state.configSaveStatu =val;
} }
} }
...@@ -99,28 +108,56 @@ export const actions = { ...@@ -99,28 +108,56 @@ export const actions = {
}) { }) {
let params = { let params = {
pageSize: 2, pageSize: 2,
sortBy: "id",
conditions: [{ conditions: [{
"fieldName": "key", "fieldName": "component",
"fieldValue": "defaultConfig,tenant-" + state.userInfo.tenantCode, "fieldValue": "defaultConfig,tenantConfig_" + util.cookies.get('tenantCode'),
"conditionalType": "In", "conditionalType": "In",
}, ] }]
} }
let { let {
result result
} = await Api.post(`${systemUrl}/config/list`, params); } = await Api.post(`${systemUrl}/config/list`, params);
if (result[0]) { if (result[0]) {
commit("setDefaultConfig", result[0]) commit("setDefaultConfig", result[0].content)
} }
if (result[1]) { if (result[1]) {
commit("setSiteConfig", result[1]) commit("setSiteConfig", result[1].content)
}else{ commit("setConfigId",result[1].id)
if(result[0]){ } else {
commit("setSiteConfig", result[0]) if (result[0]) {
commit("setSiteConfig", result[0].content)
} }
} }
}, },
async saveConfig({commit},config){ async saveConfig({
state
}, config) {
if (config.tenantCode != '') {
let configStr=JSON.stringify(config);
let params = {
id: state.configId,
page: "config",
component: "tenantConfig_"+config.tenantCode,
key:config.tenantCode,
content: configStr,
note: "配置信息"
}
await Api.post(`${systemUrl}/config/update`, params);
} else {
config.tenantCode = util.cookies.get('tenantCode')
let configStr=JSON.stringify(config);
let params = {
page: "config",
component: "tenantConfig_"+config.tenantCode,
key:config.tenantCode,
content: configStr,
note: "配置信息"
}
await Api.post(`${systemUrl}/config/create`, params);
}
} }
} }
......
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