diff --git a/src/components/company/SelectPrincipal.vue b/src/components/company/SelectPrincipal.vue index 9d4cca0..81c169a 100644 --- a/src/components/company/SelectPrincipal.vue +++ b/src/components/company/SelectPrincipal.vue @@ -3,6 +3,7 @@ v-bind="$attrs" v-on="$listeners" show-search + allowClear option-filter-prop="children" :filter-option="filterOption"> {{ `${item.realname}(${item.orgCodeTxt})` }} diff --git a/src/components/iconfont/common.less b/src/components/iconfont/common.less new file mode 100644 index 0000000..b74d329 --- /dev/null +++ b/src/components/iconfont/common.less @@ -0,0 +1,12 @@ +/* 引入 icon class 文件 */ +@import "./iconfont.css"; + +/* 设置使用字体的优先级 anticon 高 */ +:global(.anticon) { /* :global() 是为了覆盖全局class .anticon 的样式 */ + &:before { + font-family: "anticon", "anticon-jeecg" !important; + /* 默认样式是这样 + font-family: "anticon" !important; + */ + } +} \ No newline at end of file diff --git a/src/components/iconfont/iconfont.css b/src/components/iconfont/iconfont.css new file mode 100644 index 0000000..cbb2d5b --- /dev/null +++ b/src/components/iconfont/iconfont.css @@ -0,0 +1,47 @@ +@font-face { + font-family: "anticon-jeecg"; /* Project id 2798517 */ + src: url('iconfont.woff2?t=1631613073967') format('woff2'), + url('iconfont.woff?t=1631613073967') format('woff'), + url('iconfont.ttf?t=1631613073967') format('truetype'); +} + +.anticon-jeecg { + font-family: "anticon-jeecg" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.anticonmeeting:before { + content: "\e60f"; +} + +.anticonproject:before { + content: "\e609"; +} + +.anticonpack:before { + content: "\e60a"; +} + +.anticonmember:before { + content: "\e60b"; +} + +.anticondata-network-disk:before { + content: "\e60c"; +} + +.anticonfinancial:before { + content: "\e60e"; +} + +.anticoncontract:before { + content: "\e608"; +} + +.anticoncompany:before { + content: "\e607"; +} + diff --git a/src/components/iconfont/iconfont.js b/src/components/iconfont/iconfont.js new file mode 100644 index 0000000..1eb2297 --- /dev/null +++ b/src/components/iconfont/iconfont.js @@ -0,0 +1 @@ +!function(c){var t,e,a,n,o,i='',h=(h=document.getElementsByTagName("script"))[h.length-1].getAttribute("data-injectcss"),l=function(c,t){t.parentNode.insertBefore(c,t)};if(h&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function m(){o||(o=!0,a())}function d(){try{n.documentElement.doScroll("left")}catch(c){return void setTimeout(d,50)}m()}t=function(){var c,t;(t=document.createElement("div")).innerHTML=i,i=null,(c=t.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",t=c,(c=document.body).firstChild?l(t,c.firstChild):c.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()},document.addEventListener("DOMContentLoaded",e,!1)):document.attachEvent&&(a=t,n=c.document,o=!1,d(),n.onreadystatechange=function(){"complete"==n.readyState&&(n.onreadystatechange=null,m())})}(window); \ No newline at end of file diff --git a/src/components/iconfont/iconfont.json b/src/components/iconfont/iconfont.json new file mode 100644 index 0000000..0ebc5f0 --- /dev/null +++ b/src/components/iconfont/iconfont.json @@ -0,0 +1,65 @@ +{ + "id": "2798517", + "name": "zx-project", + "font_family": "anticon-jeecg", + "css_prefix_text": "anticon", + "description": "", + "glyphs": [ + { + "icon_id": "24340808", + "name": "cus_meeting", + "font_class": "meeting1", + "unicode": "e60f", + "unicode_decimal": 58895 + }, + { + "icon_id": "24340604", + "name": "cus_project", + "font_class": "project", + "unicode": "e609", + "unicode_decimal": 58889 + }, + { + "icon_id": "24340605", + "name": "cus_pack", + "font_class": "pack", + "unicode": "e60a", + "unicode_decimal": 58890 + }, + { + "icon_id": "24340606", + "name": "cus_member", + "font_class": "member", + "unicode": "e60b", + "unicode_decimal": 58891 + }, + { + "icon_id": "24340607", + "name": "cus_data-network-disk", + "font_class": "data-network-disk", + "unicode": "e60c", + "unicode_decimal": 58892 + }, + { + "icon_id": "24340609", + "name": "cus_financial", + "font_class": "financial", + "unicode": "e60e", + "unicode_decimal": 58894 + }, + { + "icon_id": "24337509", + "name": "cus_contract", + "font_class": "contract", + "unicode": "e608", + "unicode_decimal": 58888 + }, + { + "icon_id": "24337464", + "name": "cus_company", + "font_class": "company", + "unicode": "e607", + "unicode_decimal": 58887 + } + ] +} diff --git a/src/components/iconfont/iconfont.ttf b/src/components/iconfont/iconfont.ttf new file mode 100644 index 0000000..39f153e Binary files /dev/null and b/src/components/iconfont/iconfont.ttf differ diff --git a/src/components/iconfont/iconfont.woff b/src/components/iconfont/iconfont.woff new file mode 100644 index 0000000..b394c4d Binary files /dev/null and b/src/components/iconfont/iconfont.woff differ diff --git a/src/components/iconfont/iconfont.woff2 b/src/components/iconfont/iconfont.woff2 new file mode 100644 index 0000000..4d3a5eb Binary files /dev/null and b/src/components/iconfont/iconfont.woff2 differ diff --git a/src/components/menu/index.js b/src/components/menu/index.js index 6ad854a..4ef5846 100644 --- a/src/components/menu/index.js +++ b/src/components/menu/index.js @@ -146,6 +146,10 @@ export default { ) }, renderIcon (icon) { + if (icon !== 'none' && icon !== undefined && icon.indexOf('cus_') !== -1) { + let className = `anticon-jeecg anticon${icon.substr(4)}` + return + } if (icon === 'none' || icon === undefined) { return null } diff --git a/src/main.js b/src/main.js index b0ea22b..21c3af3 100644 --- a/src/main.js +++ b/src/main.js @@ -29,6 +29,10 @@ import vTrim from '@/utils/vTrim' import preventClick from '@/utils/preventClick' import '@/assets/less/JAreaLinkage.less' import VueAreaLinkage from 'vue-area-linkage' +// Fontclass模式 +import '@/components/iconfont/common.less' +// 使用 symbol模式 支持多色 +import '@/components/iconfont/iconfont.js' Vue.config.productionTip = false Vue.use(Storage, config.storageOptions) diff --git a/src/views/businessManagement/BusinessManagement.vue b/src/views/businessManagement/BusinessManagement.vue index 8b2bc96..cabfe2e 100644 --- a/src/views/businessManagement/BusinessManagement.vue +++ b/src/views/businessManagement/BusinessManagement.vue @@ -106,13 +106,13 @@ export default { }, { title: '企业名称', align: 'center', - width: 300, + width: 250, dataIndex: 'companyName', scopedSlots: { customRender: 'text' } }, { title: '公司地址', align: 'center', - width: 400, + width: 300, dataIndex: 'companyAddress', scopedSlots: { customRender: 'text' } }, { diff --git a/src/views/businessManagement/ContactManagement.vue b/src/views/businessManagement/ContactManagement.vue index 743d63e..ecab767 100644 --- a/src/views/businessManagement/ContactManagement.vue +++ b/src/views/businessManagement/ContactManagement.vue @@ -123,7 +123,7 @@ export default { }, { title: '姓名', align: 'center', - width: 160, + width: 170, dataIndex: 'name', scopedSlots: { customRender: 'text' } }, { diff --git a/src/views/projectManagement/modules/WorkingGroupProjectModule.vue b/src/views/projectManagement/modules/WorkingGroupProjectModule.vue index 64d6fb4..3c8452f 100644 --- a/src/views/projectManagement/modules/WorkingGroupProjectModule.vue +++ b/src/views/projectManagement/modules/WorkingGroupProjectModule.vue @@ -72,7 +72,7 @@ @@ -109,7 +109,7 @@ @@ -147,7 +147,7 @@ placeholder="请输入任务及目标" :auto-size="{ minRows: 3, maxRows: 6 }" v-decorator="['missionAndObjectives']" - :maxLength='300' + :maxLength='200' @change="e => {e.target.value = (e.target.value + '').trim()}"/> @@ -175,6 +175,8 @@ import { httpAction } from '@api/manage' import JUpload from '@comp/jero/JUpload' import JYearDate from '@comp/jero/JYearDate' import SelectPrincipal from '@comp/company/SelectPrincipal' +import { isRepeat } from '../../../utils/util' +import { money } from '../../../utils/validate' export default { name: 'WorkingGroupProjectModule', @@ -210,10 +212,18 @@ export default { }, year: { rules: [{ required: true, message: '请选择运行年份' }], - validateTrigger: 'blur' + validateTrigger: 'change' }, principalIdA: { - rules: [{ required: true, message: '请选择负责人A' }], + rules: [{ required: true, validator: this.validatePrincipal }], + validateTrigger: 'change' + }, + principalIdB: { + rules: [{ required: false, validator: this.validatePrincipal }], + validateTrigger: 'change' + }, + checkMoney: { + rules: [{ required: false, validator: this.checkMoney }], validateTrigger: 'blur' } }, @@ -272,7 +282,48 @@ export default { }, handleCancel() { this.close() - } + }, + /** + * 校验负责人是否重复 + * @param rule + * @param value + * @param callback + */ + validatePrincipal(rule, value, callback) { + if (rule.field === 'principalIdA') { + if (!value) { + callback('请选择负责人A') + } + } + if (value) { + const principalObj = this.form.getFieldsValue(['principalIdA', 'principalIdB']) + const principalArr = Object.values(principalObj) + principalArr.filter(tt => tt !== undefined) + if (isRepeat(principalArr)) { + callback('请选择不同的负责人') + } else { + callback() + } + callback() + return + } + callback() + }, + /** + * 校验金额格式 + * @param rules + * @param value + * @param callback + */ + checkMoney(rules, value, callback) { + if (value) { + if (money(value)) { + callback() + return + } + callback('请输入正确格式的金额') + } + }, } }