Ver código fonte

enum.js改为enum.ts

guojing_wu 1 ano atrás
pai
commit
1bfc5f55c7

+ 1 - 0
src/views/components/auto/auto-campaigns/target-rule.vue

@@ -60,3 +60,4 @@ const cancel = () => {
 </script>
 
 <style lang="scss" scoped></style>
+

+ 0 - 0
src/views/components/auto/enum.js → src/views/components/auto/enum.ts


+ 1 - 1
src/views/demo/api.ts

@@ -2,7 +2,7 @@ import { request } from '/@/utils/service';
 import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
 import XEUtils from 'xe-utils';
 
-export const apiPrefix = '/api/ad_manage/';
+export const apiPrefix = '/api/ad_manage/portfolios/';
 export function GetList(query: UserPageQuery) {
     return request({
         url: apiPrefix,

+ 10 - 158
src/views/demo/index.vue

@@ -1,167 +1,19 @@
 <template>
-  <div class="test">
-    <!-- <TimerBidTable :data="bidData" @cancel-bid="refreshTimerBid"></TimerBidTable>
-    <p>{{ bidData }}</p> -->
-    <!-- <TimerBudgetTable :data="budgetData"></TimerBudgetTable>
-    <p>{{ budgetData }}</p> -->
-
-    <!-- <InputFloat v-model="num" :prefix="prefix" :suffix="suffix" style="width: 200px;"></InputFloat>
-    <p>{{ num }}</p>
-    <el-button @click="change">切换</el-button> -->
-
-    <!-- <conditionGroup :candidate-fields="condidateFields" v-model="formData"></conditionGroup> -->
-    <!-- <conditionBuilder :candidate-fields="condidateFields" :data="formData" ref="condiBuilder"></conditionBuilder>
-    <p>{{ formData }}</p>
-    <el-button @click="save">保存</el-button> -->
-
-    <!-- <TimerBid /> -->
-    <!-- <RuleCampaign /> -->
-    <!-- <RuleTarget :candidate-fields="condidateFields"/> -->
-    <!-- <RuleSearchTerm></RuleSearchTerm> -->
-    <!-- <TagsInput :data="tags"></TagsInput> -->
-    <!-- <CampaignSelect v-model="campaignId" :query="{ profileId: '3006125408623189', campaignType: 'sp' }"></CampaignSelect> -->
-    <!-- <AdGroupSelect v-model="campaignId" :query="{ profileId: '3006125408623189', campaignType: 'sp', campaignId: '25915710734770' }" width="500px" /> -->
-    <p>---{{ campaignId }}</p>
-    <!-- <STBidInput :bid-data="stBidData"></STBidInput> -->
-  </div>
+  <fs-page>
+    <fs-crud ref="crudRef" v-bind="crudBinding" />
+  </fs-page>
 </template>
 
 <script lang="ts" setup>
-import { onMounted, ref, Ref, reactive } from 'vue'
-import TimerBidTable from '/@/components/TimerBidTable/index.vue'
-import TimerBudgetTable from '/@/components/TimerBudgetTable/index.vue'
-import InputFloat from '/@/components/input-float/index.vue'
-import conditionGroup from '/@/components/conditionBuilder/condition-group.vue'
-import conditionBuilder from '/@/components/conditionBuilder/index.vue'
+import { ref, onMounted } from 'vue'
+import { useFs } from '@fast-crud/fast-crud'
+import { createCrudOptions } from './crud'
 
-import RuleTimerBid from '/@/components/auto-templates/timer-bid.vue'
-import RuleTimerBudget from '/@/components/auto-templates/timer-budget.vue'
-import RuleCampaign from '/@/components/auto-templates/campaign.vue'
-import RuleTarget from '/@/components/auto-templates/target-rule.vue'
-import RuleSearchTerm from '/@/components/auto-templates/search-term.vue'
-import TagsInput from '/@/components/tags-input/index.vue'
-import CampaignSelect from '/@/views/components/campaign-select/index.vue'
-import AdGroupSelect from '/@/views/components/ad-group-select/index.vue'
-import STBidInput from '/@/views/components/auto/st-bid-input.vue'
+const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions })
 
-const stBidData = ref({
-  bidType: '1',
-  type: 'increase',
-  defaultBidding: '1',
-  min: '',
-  max: '',
-  matchType: '',
-  numType: '1',
+onMounted(async () => {
+  crudExpose.doRefresh()
 })
-
-const campaignId = ref('')
-
-const tags = ref(['aaa'])
-
-const condiBuilder = ref()
-const condidateFields = [
-  { label: '曝光量', value: 'impressions' },
-  { label: '点击量', value: 'clicks' },
-  { label: '转化率', value: 'cr', suffix: '%' },
-  { label: '单次点击费用', value: 'cpc', prefix: '$' },
-]
-const formData = reactive([
-  {
-    key: '1',
-    day: 1,
-    exceptDay: 0,
-    items: [
-      {
-        dataType: 'impressions',
-        dayType: 'sum',
-        symbol: 'gte',
-        num: '1000',
-      },
-    ],
-  },
-  {
-    key: '2',
-    day: 7,
-    exceptDay: 0,
-    items: [
-      {
-        dataType: 'clicks',
-        dayType: 'sum',
-        symbol: 'lte',
-        num: '100',
-      },
-    ],
-  },
-])
-
-const validateForm = async () => {
-  const validList = await condiBuilder.value.validate()
-  // console.log(validList)
-  for (const items of validList) {
-    if (items.includes(false)) {
-      return false
-    }
-  }
-  return true
-}
-const save = async () => {
-  if (await validateForm()) {
-    console.log('save')
-  } else {
-    console.log('not save')
-  }
-}
-
-const prefix = ref('')
-const suffix = ref('')
-const b = ref(false)
-const change = () => {
-  b.value = !b.value
-  if (b.value) {
-    prefix.value = '$'
-    suffix.value = ''
-  } else {
-    prefix.value = ''
-    suffix.value = '%'
-  }
-  num.value += '1'
-}
-
-const bidData = ref([])
-const budgetData = ref([])
-const num = ref('1')
-
-onMounted(() => {
-  reqData()
-})
-const initData = () => {
-  for (let i = 0; i < 7; i++) {
-    const tmp = []
-    const tmp2 = []
-    for (let j = 0; j < 24; j++) {
-      tmp.push(1)
-      tmp2.push({ type: '', value: '' })
-    }
-    bidData.value.push(tmp)
-    budgetData.value.push(tmp2)
-  }
-}
-
-const reqData = () => {
-  setTimeout(() => {
-    initData()
-    console.log('----req')
-  }, 2000)
-}
-
-const refreshTimerBid = () => {
-  console.log('refreshTimerBid')
-}
 </script>
 
-<style scoped>
-.test {
-  padding: 10px;
-  background-color: #fff;
-}
-</style>
+<style scoped></style>