修改页面路径

main
GaoF 2024-08-02 09:25:37 +08:00
parent 8eff8f1952
commit facfa8b2fa
36 changed files with 262 additions and 504 deletions

View File

@ -4,12 +4,14 @@
<a-col :span="item.span || 6" v-for="(item, index) in formItems" :key="index"> <a-col :span="item.span || 6" v-for="(item, index) in formItems" :key="index">
<a-form-item :label="item.label" :name="item.name" :rules="item.rules"> <a-form-item :label="item.label" :name="item.name" :rules="item.rules">
<component <component
v-if="!item.isUseSlot"
style="width: 100%" style="width: 100%"
:is="item.type" :is="item.type"
v-model:value="model[item.name]" v-model:value="model[item.name]"
:disabled="allDisabled" :disabled="allDisabled"
v-bind="item.attrs" v-bind="item.attrs"
/> />
<slot :name="item.slotName" :item="item" :model="model" v-else></slot>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>

View File

@ -25,7 +25,7 @@
class="s-tool-item" class="s-tool-item"
v-if="item.name === 'refresh' && props.toolConfig.refresh" v-if="item.name === 'refresh' && props.toolConfig.refresh"
> >
<component class="icons" :is="item.icon" @click="loadTreeData()"></component> <component class="icons" :is="item.icon" @click="handleRefresh"></component>
</a-tooltip> </a-tooltip>
</span> </span>
</div> </div>
@ -91,7 +91,7 @@
} }
}) })
const emit = defineEmits(['selectTree', 'delTree']) const emit = defineEmits(['selectTree', 'delTree', 'treeRefresh'])
const tool = [ const tool = [
{ {
@ -124,7 +124,7 @@
{ {
id: 0, id: 0,
parentId: '-1', parentId: '-1',
name: '顶级', name: '所有',
children: '' children: ''
} }
]) ])
@ -154,11 +154,15 @@
}) })
} }
const handleRefresh = () => {
loadTreeData()
emit('treeRefresh')
}
const loadTreeData = async () => { const loadTreeData = async () => {
try { try {
localLoading.value = true localLoading.value = true
const treeRes = await props.apiModel.getTree() const treeRes = await props.apiModel.getTree()
console.log(treeRes, 'treeRes')
if (Array.isArray(treeRes)) { if (Array.isArray(treeRes)) {
treeData.value[0].children = treeRes treeData.value[0].children = treeRes
} else { } else {
@ -168,7 +172,7 @@
if (selectedKeys.value.length > 0) { if (selectedKeys.value.length > 0) {
selectedKeys.value = [] selectedKeys.value = []
props.tableRef.refresh() // props.tableRef.refresh()
} }
if (treeRow.id) { if (treeRow.id) {

View File

@ -143,7 +143,6 @@
emit('expand', expanded, record) emit('expand', expanded, record)
} }
" "
tableLayout="fixed"
@resizeColumn="handleResizeColumn" @resizeColumn="handleResizeColumn"
:rowClassName=" :rowClassName="
(record, index) => (data.localSettings.rowClassNameSwitch ? ((index + 1) % 2 == 0 ? 'odd' : '') : null) (record, index) => (data.localSettings.rowClassNameSwitch ? ((index + 1) % 2 == 0 ? 'odd' : '') : null)

View File

@ -110,7 +110,7 @@
activeKey.value = to.path activeKey.value = to.path
if (to.name) { if (to.name) {
vStore.pushViewTags(to) vStore.pushViewTags(to)
kStore.pushKeepLive(to.name) // kStore.pushKeepLive(to.name)
} }
if (tagList.value.length - 1 > maxTabs.value) { if (tagList.value.length - 1 > maxTabs.value) {
const firstTag = tagList.value[1] const firstTag = tagList.value[1]

View File

@ -42,7 +42,7 @@
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>
<div v-if="setDrawer === 'true'" class="setting panel-item" @click="openSetting"> <div class="setting panel-item" @click="openSetting">
<layout-outlined /> <layout-outlined />
</div> </div>
</div> </div>

View File

@ -18,7 +18,7 @@ export const viewTagsStore = defineStore('viewTags', () => {
const pushViewTags = (route) => { const pushViewTags = (route) => {
const target = viewTags.value.find((item) => item.path === route.path) const target = viewTags.value.find((item) => item.path === route.path)
const isName = route.name const isName = route.name
if (!target && isName) { if (!target) {
viewTags.value.push(route) viewTags.value.push(route)
} }
if (target) { if (target) {

View File

@ -371,13 +371,13 @@ body,
.admin-ui-main{ .admin-ui-main{
&::-webkit-scrollbar { &::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width : 0; /*高宽分别对应横竖滚动条的尺寸*/ width : 5px; /*高宽分别对应横竖滚动条的尺寸*/
height: 0; height: 5px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius : 10px; border-radius : 10px;
background-color: @component-background; // skyblue background-color: #CCCCCC; // skyblue
background-image: -webkit-linear-gradient( background-image: -webkit-linear-gradient(
45deg, 45deg,
rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 25%,

View File

@ -1,175 +1,59 @@
const cityOptions = [ const cityOptions = [{
{ "code": "110000",
"code": "110000", "label": "北京市",
"value": "北京市", "value": "北京市",
"label": "北京市", "children": [
"children": [ {
{ "code": "110100",
"code": "110101", "label": "北京市",
"value": "东城区", "value": "北京市",
"label": "东城区" "children": [
}, { "code": "110101", "label": "东城区", "value": "东城区" },
{ { "code": "110102", "label": "西城区", "value": "西城区" },
"code": "110102", { "code": "110105", "label": "朝阳区", "value": "朝阳区" },
"value": "西城区", { "code": "110106", "label": "丰台区", "value": "丰台区" },
"label": "西城区" { "code": "110107", "label": "石景山区", "value": "石景山区" },
}, { "code": "110108", "label": "海淀区", "value": "海淀区" },
{ { "code": "110109", "label": "门头沟区", "value": "门头沟区" },
"code": "110105", { "code": "110111", "label": "房山区", "value": "房山区" },
"value": "朝阳区", { "code": "110112", "label": "通州区", "value": "通州区" },
"label": "朝阳区" { "code": "110113", "label": "顺义区", "value": "顺义区" },
}, { "code": "110114", "label": "昌平区", "value": "昌平区" },
{ { "code": "110115", "label": "大兴区", "value": "大兴区" },
"code": "110106", { "code": "110116", "label": "怀柔区", "value": "怀柔区" },
"value": "丰台区", { "code": "110117", "label": "平谷区", "value": "平谷区" },
"label": "丰台区" { "code": "110228", "label": "密云区", "value": "密云区" },
}, { "code": "110229", "label": "延庆区", "value": "延庆区" }
{ ]
"code": "110107", }
"value": "石景山区", ]
"label": "石景山区" },
},
{
"code": "110108",
"value": "海淀区",
"label": "海淀区"
},
{
"code": "110109",
"value": "门头沟区",
"label": "门头沟区"
},
{
"code": "110111",
"value": "房山区",
"label": "房山区"
},
{
"code": "110112",
"value": "通州区",
"label": "通州区"
},
{
"code": "110113",
"value": "顺义区",
"label": "顺义区"
},
{
"code": "110114",
"value": "昌平区",
"label": "昌平区"
},
{
"code": "110115",
"value": "大兴区",
"label": "大兴区"
},
{
"code": "110116",
"value": "怀柔区",
"label": "怀柔区"
},
{
"code": "110117",
"value": "平谷区",
"label": "平谷区"
},
{
"code": "110118",
"value": "密云区",
"label": "密云区"
},
{
"code": "110119",
"value": "延庆区",
"label": "延庆区"
}
]
},
{ {
"code": "120000", "code": "120000",
"value": "天津市",
"label": "天津市", "label": "天津市",
"value": "天津市",
"children": [ "children": [
{ {
"code": "120101", "code": "120100",
"value": "和平区", "label": "天津市",
"label": "和平区" "value": "天津市",
}, "children": [
{ { "code": "120101", "label": "和平区", "value": "和平区" },
"code": "120102", { "code": "120102", "label": "河东区", "value": "河东区" },
"value": "河东区", { "code": "120103", "label": "河西区", "value": "河西区" },
"label": "河东区" { "code": "120104", "label": "南开区", "value": "南开区" },
}, { "code": "120105", "label": "河北区", "value": "河北区" },
{ { "code": "120106", "label": "红桥区", "value": "红桥区" },
"code": "120103", { "code": "120110", "label": "东丽区", "value": "东丽区" },
"value": "河西区", { "code": "120111", "label": "西青区", "value": "西青区" },
"label": "河西区" { "code": "120112", "label": "津南区", "value": "津南区" },
}, { "code": "120113", "label": "北辰区", "value": "北辰区" },
{ { "code": "120114", "label": "武清区", "value": "武清区" },
"code": "120104", { "code": "120115", "label": "宝坻区", "value": "宝坻区" },
"value": "南开区", { "code": "120116", "label": "滨海新区", "value": "滨海新区" },
"label": "南开区" { "code": "120117", "label": "静海区", "value": "静海区" },
}, { "code": "120118", "label": "蓟州区", "value": "蓟州区" }
{ ]
"code": "120105",
"value": "河北区",
"label": "河北区"
},
{
"code": "120106",
"value": "红桥区",
"label": "红桥区"
},
{
"code": "120110",
"value": "东丽区",
"label": "东丽区"
},
{
"code": "120111",
"value": "西青区",
"label": "西青区"
},
{
"code": "120112",
"value": "津南区",
"label": "津南区"
},
{
"code": "120113",
"value": "北辰区",
"label": "北辰区"
},
{
"code": "120114",
"value": "武清区",
"label": "武清区"
},
{
"code": "120115",
"value": "宝坻区",
"label": "宝坻区"
},
{
"code": "120116",
"value": "滨海新区",
"label": "滨海新区"
},
{
"code": "120117",
"value": "宁河区",
"label": "宁河区"
},
{
"code": "120118",
"value": "静海区",
"label": "静海区"
},
{
"code": "120119",
"value": "蓟州区",
"label": "蓟州区"
} }
] ]
}, },
@ -4047,91 +3931,34 @@ const cityOptions = [
}, },
{ {
"code": "310000", "code": "310000",
"value": "上海市",
"label": "上海市", "label": "上海市",
"value": "上海市",
"children": [ "children": [
{ {
"code": "310101", "code": "310100",
"value": "黄浦区", "label": "上海市",
"label": "黄浦区" "value": "上海市",
}, "children": [
{ { "code": "310101", "label": "黄浦区", "value": "黄浦区" },
"code": "310104", { "code": "310104", "label": "徐汇区", "value": "徐汇区" },
"value": "徐汇区", { "code": "310105", "label": "长宁区", "value": "长宁区" },
"label": "徐汇区" { "code": "310106", "label": "静安区", "value": "静安区" },
}, { "code": "310107", "label": "普陀区", "value": "普陀区" },
{ { "code": "310109", "label": "虹口区", "value": "虹口区" },
"code": "310105", { "code": "310110", "label": "杨浦区", "value": "杨浦区" },
"value": "长宁区", { "code": "310112", "label": "浦东新区", "value": "浦东新区" },
"label": "长宁区" { "code": "310113", "label": "闵行区", "value": "闵行区" },
}, { "code": "310114", "label": "宝山区", "value": "宝山区" },
{ { "code": "310115", "label": "嘉定区", "value": "嘉定区" },
"code": "310106", { "code": "310116", "label": "南汇区", "value": "南汇区" },
"value": "静安区", { "code": "310117", "label": "奉贤区", "value": "奉贤区" },
"label": "静安区" { "code": "310118", "label": "青浦区", "value": "青浦区" },
}, { "code": "310120", "label": "崇明区", "value": "崇明区" }
{ ]
"code": "310107",
"value": "普陀区",
"label": "普陀区"
},
{
"code": "310109",
"value": "虹口区",
"label": "虹口区"
},
{
"code": "310110",
"value": "杨浦区",
"label": "杨浦区"
},
{
"code": "310112",
"value": "闵行区",
"label": "闵行区"
},
{
"code": "310113",
"value": "宝山区",
"label": "宝山区"
},
{
"code": "310114",
"value": "嘉定区",
"label": "嘉定区"
},
{
"code": "310115",
"value": "浦东新区",
"label": "浦东新区"
},
{
"code": "310116",
"value": "金山区",
"label": "金山区"
},
{
"code": "310117",
"value": "松江区",
"label": "松江区"
},
{
"code": "310118",
"value": "青浦区",
"label": "青浦区"
},
{
"code": "310120",
"value": "奉贤区",
"label": "奉贤区"
},
{
"code": "310151",
"value": "崇明区",
"label": "崇明区"
} }
] ]
}, },
{ {
"code": "320000", "code": "320000",
"value": "江苏省", "value": "江苏省",
@ -11482,198 +11309,43 @@ const cityOptions = [
}, },
{ {
"code": "500000", "code": "500000",
"value": "重庆市",
"label": "重庆市", "label": "重庆市",
"value": "重庆市",
"children": [ "children": [
{ {
"code": "500101", "code": "500100",
"value": "万州区", "label": "重庆市",
"label": "万州区" "value": "重庆市",
}, "children": [
{ { "code": "500101", "label": "渝中区", "value": "渝中区" },
"code": "500102", { "code": "500102", "label": "江北区", "value": "江北区" },
"value": "涪陵区", { "code": "500103", "label": "南岸区", "value": "南岸区" },
"label": "涪陵区" { "code": "500104", "label": "北碚区", "value": "北碚区" },
}, { "code": "500105", "label": "渝北区", "value": "渝北区" },
{ { "code": "500106", "label": "巴南区", "value": "巴南区" },
"code": "500103", { "code": "500107", "label": "合川区", "value": "合川区" },
"value": "渝中区", { "code": "500108", "label": "永川区", "value": "永川区" },
"label": "渝中区" { "code": "500109", "label": "江津区", "value": "江津区" },
}, { "code": "500110", "label": "沙坪坝区", "value": "沙坪坝区" },
{ { "code": "500111", "label": "九龙坡区", "value": "九龙坡区" },
"code": "500104", { "code": "500112", "label": "大渡口区", "value": "大渡口区" },
"value": "大渡口区", { "code": "500113", "label": "铜梁区", "value": "铜梁区" },
"label": "大渡口区" { "code": "500114", "label": "潼南区", "value": "潼南区" },
}, { "code": "500115", "label": "荣昌区", "value": "荣昌区" },
{ { "code": "500116", "label": "梁平区", "value": "梁平区" },
"code": "500105", { "code": "500117", "label": "武隆区", "value": "武隆区" },
"value": "江北区", { "code": "500118", "label": "丰都县", "value": "丰都县" },
"label": "江北区" { "code": "500119", "label": "忠县", "value": "忠县" },
}, { "code": "500120", "label": "开县", "value": "开县" },
{ { "code": "500121", "label": "云阳县", "value": "云阳县" },
"code": "500106", { "code": "500122", "label": "奉节县", "value": "奉节县" },
"value": "沙坪坝区", { "code": "500123", "label": "巫山县", "value": "巫山县" },
"label": "沙坪坝区" { "code": "500124", "label": "巫溪县", "value": "巫溪县" },
}, { "code": "500125", "label": "石柱土家族自治县", "value": "石柱土家族自治县" },
{ { "code": "500126", "label": "秀山土家族苗族自治县", "value": "秀山土家族苗族自治县" },
"code": "500107", { "code": "500127", "label": "酉阳土家族苗族自治县", "value": "酉阳土家族苗族自治县" },
"value": "九龙坡区", { "code": "500128", "label": "彭水苗族土家族自治县", "value": "彭水苗族土家族自治县" }
"label": "九龙坡区" ]
},
{
"code": "500108",
"value": "南岸区",
"label": "南岸区"
},
{
"code": "500109",
"value": "北碚区",
"label": "北碚区"
},
{
"code": "500110",
"value": "綦江区",
"label": "綦江区"
},
{
"code": "500111",
"value": "大足区",
"label": "大足区"
},
{
"code": "500112",
"value": "渝北区",
"label": "渝北区"
},
{
"code": "500113",
"value": "巴南区",
"label": "巴南区"
},
{
"code": "500114",
"value": "黔江区",
"label": "黔江区"
},
{
"code": "500115",
"value": "长寿区",
"label": "长寿区"
},
{
"code": "500116",
"value": "江津区",
"label": "江津区"
},
{
"code": "500117",
"value": "合川区",
"label": "合川区"
},
{
"code": "500118",
"value": "永川区",
"label": "永川区"
},
{
"code": "500119",
"value": "南川区",
"label": "南川区"
},
{
"code": "500120",
"value": "璧山区",
"label": "璧山区"
},
{
"code": "500151",
"value": "铜梁区",
"label": "铜梁区"
},
{
"code": "500152",
"value": "潼南区",
"label": "潼南区"
},
{
"code": "500153",
"value": "荣昌区",
"label": "荣昌区"
},
{
"code": "500154",
"value": "开州区",
"label": "开州区"
},
{
"code": "500155",
"value": "梁平区",
"label": "梁平区"
},
{
"code": "500156",
"value": "武隆区",
"label": "武隆区"
},
{
"code": "500229",
"value": "城口县",
"label": "城口县"
},
{
"code": "500230",
"value": "丰都县",
"label": "丰都县"
},
{
"code": "500231",
"value": "垫江县",
"label": "垫江县"
},
{
"code": "500233",
"value": "忠县",
"label": "忠县"
},
{
"code": "500235",
"value": "云阳县",
"label": "云阳县"
},
{
"code": "500236",
"value": "奉节县",
"label": "奉节县"
},
{
"code": "500237",
"value": "巫山县",
"label": "巫山县"
},
{
"code": "500238",
"value": "巫溪县",
"label": "巫溪县"
},
{
"code": "500240",
"value": "石柱土家族自治县",
"label": "石柱土家族自治县"
},
{
"code": "500241",
"value": "秀山土家族苗族自治县",
"label": "秀山土家族苗族自治县"
},
{
"code": "500242",
"value": "酉阳土家族苗族自治县",
"label": "酉阳土家族苗族自治县"
},
{
"code": "500243",
"value": "彭水苗族土家族自治县",
"label": "彭水苗族土家族自治县"
} }
] ]
}, },
@ -16633,3 +16305,5 @@ const cityOptions = [
] ]
export default cityOptions export default cityOptions

View File

@ -23,11 +23,6 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-item label="字段类型:" name="fieldType">
<a-input v-model:value="formData.fieldType" placeholder="请输入字段名" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="展示形式:" name="showType"> <a-form-item label="展示形式:" name="showType">
<a-select <a-select
@ -54,7 +49,7 @@
<a-col <a-col
:span="24" :span="24"
v-if="formData.showType && formData.showType !== 'input' && formData.showType !== 'inputNumber'" v-if="formData.showType && formData.showType !== 'a-input' && formData.showType !== 'a-input-number'"
> >
<h3>扩展数据</h3> <h3>扩展数据</h3>
<div v-for="(item, index) in selectableData" :key="index" class="mb-2"> <div v-for="(item, index) in selectableData" :key="index" class="mb-2">
@ -139,15 +134,14 @@
// //
const formRules = { const formRules = {
name: [required('请输入名称')], name: [required('请输入名称')],
fieldType: [required('请输入类型')],
model: [required('请输入模块')] model: [required('请输入模块')]
} }
// //
const onSubmit = () => { const onSubmit = () => {
if ( if (
formData.value.showType === 'select' && formData.value.showType === 'a-select' &&
formData.value.showType === 'radio' && formData.value.showType === 'a-radio-group' &&
formData.value.showType === 'checkbox' && formData.value.showType === 'a-checkbox-group' &&
selectableData.value.length === 0 selectableData.value.length === 0
) { ) {
return message.error('请添加选项要展示的数据') return message.error('请添加选项要展示的数据')
@ -156,7 +150,7 @@
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
submitLoading.value = true submitLoading.value = true
const formDataParam = cloneDeep(formData.value) const formDataParam = cloneDeep(formData.value)
if (formDataParam.showType === 'input' || formDataParam.showType === 'inputNumber') { if (formDataParam.showType === 'a-input' || formDataParam.showType === 'a-input-number') {
formDataParam.showValues = '' formDataParam.showValues = ''
} else { } else {
formDataParam.showValues = JSON.stringify(selectableData.value) formDataParam.showValues = JSON.stringify(selectableData.value)

View File

@ -62,10 +62,10 @@
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<a-space> <a-space>
<a @click="formRef.onOpen(record)" v-if="hasPerm('extendFieldEdit')"></a> <a @click="formRef.onOpen(record)" v-if="hasPerm('extendFieldEdit')"></a>
<a-divider type="vertical" v-if="hasPerm(['extendFieldEdit', 'extendFieldDelete'], 'and')" /> <!-- <a-divider type="vertical" v-if="hasPerm(['extendFieldEdit', 'extendFieldDelete'], 'and')" />
<a-popconfirm title="确定要删除吗?" @confirm="deleteExtendField(record)"> <a-popconfirm title="确定要删除吗?" @confirm="deleteExtendField(record)">
<a-button type="link" danger size="small" v-if="hasPerm('extendFieldDelete')"></a-button> <a-button type="link" danger size="small" v-if="hasPerm('extendFieldDelete')"></a-button>
</a-popconfirm> </a-popconfirm>-->
</a-space> </a-space>
</template> </template>
</template> </template>

View File

@ -85,7 +85,7 @@
{ {
id: 0, id: 0,
parentId: '0', parentId: '0',
name: '顶级', name: '所有',
children: res ? res : [] children: res ? res : []
} }
] ]

View File

@ -12,7 +12,40 @@
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
ref="formRef1" ref="formRef1"
/> >
<template #provinceSlot="{ model, item }">
<a-select
:filter-option="filterOption"
show-search
placeholder="请选择省"
:options="cityOptions"
v-model:value="model[item.name]"
@change="onChangeProvince"
>
</a-select>
</template>
<template #citySlot="{ model, item }">
<a-select
:filter-option="filterOption"
show-search
placeholder="请选择市"
:options="cityOptionsCity"
v-model:value="model[item.name]"
@change="onChangeCity"
>
</a-select>
</template>
<template #countySlot="{ model, item }">
<a-select
:filter-option="filterOption"
show-search
placeholder="请选择区"
:options="cityOptionsCounty"
v-model:value="model[item.name]"
>
</a-select>
</template>
</DynamicForm>
</a-card> </a-card>
<a-card :bordered="false" class="mt-4"> <a-card :bordered="false" class="mt-4">
@ -47,6 +80,7 @@
provinceChange(value, options, record) provinceChange(value, options, record)
} }
" "
:filter-option="filterOption"
></a-select> ></a-select>
</template> </template>
<template v-if="column.dataIndex === 'city'"> <template v-if="column.dataIndex === 'city'">
@ -59,10 +93,16 @@
cityChange(value, options, record) cityChange(value, options, record)
} }
" "
:filter-option="filterOption"
></a-select> ></a-select>
</template> </template>
<template v-if="column.dataIndex === 'county'"> <template v-if="column.dataIndex === 'county'">
<a-select style="width: 100%" :options="record.countyOptions" v-model:value="record.county"></a-select> <a-select
:filter-option="filterOption"
style="width: 100%"
:options="record.countyOptions"
v-model:value="record.county"
></a-select>
</template> </template>
<template v-if="column.dataIndex === 'remarks'"> <template v-if="column.dataIndex === 'remarks'">
<a-textarea style="width: 100%" v-model:value="record.remarks"></a-textarea> <a-textarea style="width: 100%" v-model:value="record.remarks"></a-textarea>
@ -98,10 +138,20 @@
let detailData = reactive({}) let detailData = reactive({})
// //
const onCascaderChange = (value) => { let cityOptionsCity = ref([])
formData.province = value[0] && value[0] let cityOptionsCounty = ref([])
formData.city = value[1] && value[1]
formData.county = value[2] && value[2] const onChangeProvince = (value, options) => {
console.log(options)
cityOptionsCity.value = options.children
}
const onChangeCity = (value, options) => {
cityOptionsCounty.value = options.children
}
const filterOption = (input, option) => {
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
} }
const clientFormItems = reactive([ const clientFormItems = reactive([
@ -179,17 +229,32 @@
} }
}, },
{ {
label: '详细地址:', label: '省:',
name: 'provinceName', name: 'province',
type: 'a-cascader',
span: 8, span: 8,
rules: [required('请选择详细地址')], rules: [required('请选择省')],
isUseSlot: true,
slotName: 'provinceSlot',
attrs: { attrs: {
placeholder: '请选择详细地址', placeholder: '请选择省'
options: cityOptions,
onChange: onCascaderChange
} }
}, },
{
label: '市:',
name: 'city',
span: 8,
rules: [required('请选择市')],
isUseSlot: true,
slotName: 'citySlot'
},
{
label: '区:',
name: 'county',
isUseSlot: true,
slotName: 'countySlot',
span: 8,
rules: [required('请选择区')],
},
{ {
name: 'address', name: 'address',
type: 'a-textarea', type: 'a-textarea',
@ -331,8 +396,6 @@
if (res) { if (res) {
detailData = res detailData = res
formData.provinceName = [res.province, res.city, res.county]
customerApi customerApi
.customerSaleAreaList({ .customerSaleAreaList({
customerId: res.id customerId: res.id
@ -364,7 +427,14 @@
.then((res) => { .then((res) => {
clientFormItems.forEach((item) => { clientFormItems.forEach((item) => {
if (item.name === 'categoryId') { if (item.name === 'categoryId') {
item.attrs.treeData = res item.attrs.treeData = [
{
id: 0,
parentId: '-1',
name: '所有',
children: res || []
}
]
} }
}) })
}) })

View File

@ -43,6 +43,7 @@
}" }"
@selectTree="selectTree" @selectTree="selectTree"
@delTree="delTree" @delTree="delTree"
@treeRefresh="treeRefresh"
></dynamic-tree> ></dynamic-tree>
</a-col> </a-col>
<a-col :span="18"> <a-col :span="18">
@ -145,7 +146,7 @@
import customerApi from '@/api/base/customer/customerApi' import customerApi from '@/api/base/customer/customerApi'
import customerCategoryApi from '@/api/base/customer/customerCategoryApi' import customerCategoryApi from '@/api/base/customer/customerCategoryApi'
import { useTableManagement } from '@/hook/useTableManagement' import { useTableManagement } from '@/hook/useTableManagement'
import CustomerCategoryForm from '@/views/basicData/client/detail/CustomerCategoryForm.vue' import CustomerCategoryForm from '@/views/productionBusiness/basicData/client/detail/CustomerCategoryForm.vue'
const clientColumn = [ const clientColumn = [
{ {
@ -228,6 +229,11 @@
tableRef.value.refresh() tableRef.value.refresh()
} }
const treeRefresh = () => {
searchFormState.value.categoryId = null
tableRef.value.refresh()
}
const successful = () => { const successful = () => {
searchFormState.value.categoryId = null searchFormState.value.categoryId = null
tableRef.value.refresh() tableRef.value.refresh()

View File

@ -93,7 +93,7 @@
{ {
id: 0, id: 0,
parentId: '0', parentId: '0',
name: '顶级', name: '所有',
children: res ? res : [] children: res ? res : []
} }
] ]

View File

@ -43,6 +43,7 @@
}" }"
@selectTree="selectTree" @selectTree="selectTree"
@delTree="delTree" @delTree="delTree"
@treeRefresh="treeRefresh"
></dynamic-tree> ></dynamic-tree>
</a-col> </a-col>
<a-col :span="18"> <a-col :span="18">
@ -145,9 +146,9 @@
<script setup name="materiel"> <script setup name="materiel">
import materialApi from '@/api/base/material/materialApi' import materialApi from '@/api/base/material/materialApi'
import materialCategoryApi from '@/api/base/material/materialCategoryApi' import materialCategoryApi from '@/api/base/material/materialCategoryApi'
import MaterialCategoryForm from '@/views/basicData/materiel/detail/materialCategoryForm.vue' import MaterialCategoryForm from '@/views/productionBusiness/basicData/materiel/detail/materialCategoryForm.vue'
import { useTableManagement } from '@/hook/useTableManagement' import { useTableManagement } from '@/hook/useTableManagement'
import { materielColumn } from '@/views/basicData/materiel/column/materiel-column' import { materielColumn } from '@/views/productionBusiness/basicData/materiel/column/materiel-column'
const materialCategoryFormRef = ref(null) const materialCategoryFormRef = ref(null)
const dynamicTreeRef = ref(null) const dynamicTreeRef = ref(null)
@ -178,6 +179,11 @@
tableRef.value.refresh() tableRef.value.refresh()
} }
const treeRefresh = () => {
searchFormState.value.categoryId = null
tableRef.value.refresh()
}
const delTree = () => { const delTree = () => {
searchFormState.value.categoryId = null searchFormState.value.categoryId = null
tableRef.value.refresh() tableRef.value.refresh()

View File

@ -263,7 +263,7 @@
{ {
id: 0, id: 0,
parentId: '-1', parentId: '-1',
name: '顶级', name: '所有',
children: sysStoreTreeList || [] children: sysStoreTreeList || []
} }
] ]

View File

@ -41,6 +41,7 @@
delTree: sysStoreApi.productionOrganizationDelete delTree: sysStoreApi.productionOrganizationDelete
}" }"
@selectTree="onSelectTree" @selectTree="onSelectTree"
@treeRefresh="treeRefresh"
:toolConfig="{ :toolConfig="{
plus: false, plus: false,
edit: false, edit: false,
@ -222,6 +223,11 @@
tableRef.value.refresh() tableRef.value.refresh()
} }
const treeRefresh = () => {
searchFormState.value.parentId = null
tableRef.value.refresh()
}
onMounted(() => { onMounted(() => {
dynamicTreeRef.value.loadTreeData() dynamicTreeRef.value.loadTreeData()
}) })

View File

@ -74,8 +74,8 @@
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12" v-if="formData.type === 'FACTORY'">
<a-form-item label="厂家名称:" name="manufacturer" v-if="formData.type === 'FACTORY'"> <a-form-item label="厂家名称:" name="manufacturer">
<a-input <a-input
:disabled="pageType === 'SEARCH'" :disabled="pageType === 'SEARCH'"
v-model:value="formData.manufacturer" v-model:value="formData.manufacturer"

View File

@ -56,6 +56,7 @@
}" }"
@selectTree="onSelectTree" @selectTree="onSelectTree"
@delTree="delTree" @delTree="delTree"
@treeRefresh="treeRefresh"
:toolConfig="{ :toolConfig="{
plus: false, plus: false,
edit: false, edit: false,
@ -83,7 +84,7 @@
<a-space> <a-space>
<a-button type="primary" @click="TissueFormRef.onOpen()" v-if="hasPerm('officialAccountAdd')"> <a-button type="primary" @click="TissueFormRef.onOpen()" v-if="hasPerm('officialAccountAdd')">
<template #icon><plus-outlined /></template> <template #icon><plus-outlined /></template>
新增工厂 新增
</a-button> </a-button>
<xn-batch-delete <xn-batch-delete
v-if="hasPerm('officialAccountBatchDelete')" v-if="hasPerm('officialAccountBatchDelete')"
@ -138,7 +139,7 @@
<script setup name="basicDataPublicAccount"> <script setup name="basicDataPublicAccount">
import productionOrganizationApi from '@/api/base/production-organization/productionOrganizationApi' import productionOrganizationApi from '@/api/base/production-organization/productionOrganizationApi'
import { useTableManagement } from '@/hook/useTableManagement' import { useTableManagement } from '@/hook/useTableManagement'
import TissueForm from '@/views/basicData/tissue/detail/TissueForm.vue' import TissueForm from '@/views/productionBusiness/basicData/tissue/detail/TissueForm.vue'
import tool from '@/utils/tool' import tool from '@/utils/tool'
const publicAccountColumn = [ const publicAccountColumn = [
@ -222,6 +223,11 @@
tableRef.value.refresh() tableRef.value.refresh()
} }
const treeRefresh = () => {
searchFormState.value.parentId = null
tableRef.value.refresh()
}
const successful = () => { const successful = () => {
searchFormState.value.parentId = null searchFormState.value.parentId = null
tableRef.value.refresh() tableRef.value.refresh()

View File

@ -48,16 +48,6 @@ export const unitColumns = [
resizable: true, resizable: true,
align: 'center', align: 'center',
ellipsis: true ellipsis: true
},
{
title: '换算率',
dataIndex: 'rate',
width: 200,
resizable: true,
align: 'center',
sorter: true,
sortDirections: ['descend', 'ascend'],
ellipsis: true
} }
] ]
@ -65,7 +55,7 @@ export const unitGroupColumns = [
{ {
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
width: 180, width: 100,
resizable: true, resizable: true,
align: 'center' align: 'center'
}, },

View File

@ -121,7 +121,7 @@
}, },
{ {
label: '换算率:', label: '换算率:',
name: 'number', name: 'rate',
type: 'a-input-number', type: 'a-input-number',
span: 6, span: 6,
attrs: { attrs: {

View File

@ -90,11 +90,11 @@
:tool-config="options.toolConfig" :tool-config="options.toolConfig"
:row-selection="options.rowSelection" :row-selection="options.rowSelection"
:scroll="{ :scroll="{
x: 100, x: 1500,
y: 'calc(100vh - 300px)' y: 'calc(100vh - 300px)'
}" }"
> >
<template #operator class="table-operator"> <template #operator>
<a-space> <a-space>
<a-button <a-button
type="primary" type="primary"
@ -160,7 +160,7 @@
</a-tooltip> </a-tooltip>
<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" /> <a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
<a-popconfirm title="确定要删除吗?" @confirm="deleteSysUnit(record)"> <a-popconfirm title="确定要删除吗?" @confirm="deleteRecord(record)">
<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')"> <a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">
<DeleteOutlined /> <DeleteOutlined />
<!-- 删除--> <!-- 删除-->
@ -182,8 +182,8 @@
import sysUnitGroupsApi from '@/api/base/unit/unitGroupsApi' import sysUnitGroupsApi from '@/api/base/unit/unitGroupsApi'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { unitColumns, unitGroupColumns } from '@/views/basicData/unit/columns/unitColumns' import { unitColumns, unitGroupColumns } from '@/views/productionBusiness/basicData/unit/columns/unitColumns'
import UnitGroupForm from '@/views/basicData/unit/detail/UnitGroupForm.vue' import UnitGroupForm from '@/views/productionBusiness/basicData/unit/detail/UnitGroupForm.vue'
import { useTableManagement } from '@/hook/useTableManagement' import { useTableManagement } from '@/hook/useTableManagement'
import tool from '@/utils/tool' import tool from '@/utils/tool'
@ -200,7 +200,8 @@
searchFormRef, searchFormRef,
navigateTo, navigateTo,
toggleAdvanced, toggleAdvanced,
advanced advanced,
deleteRecord
} = useTableManagement( } = useTableManagement(
{ {
page: sysUnitApi.sysUnitPage, page: sysUnitApi.sysUnitPage,